Skip to content

Commit

Permalink
Add tests for MinReplicasDeployment
Browse files Browse the repository at this point in the history
  • Loading branch information
zegl committed Nov 25, 2024
1 parent 7c7f9d7 commit e8566e3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion score/deployment_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package score

import (
"github.com/zegl/kube-score/config"
"testing"

"github.com/zegl/kube-score/config"

"github.com/stretchr/testify/assert"
ks "github.com/zegl/kube-score/domain"
"github.com/zegl/kube-score/scorecard"
Expand Down Expand Up @@ -55,6 +56,20 @@ func TestServiceTargetsDeploymentReplicasNok(t *testing.T) {
}, "Deployment Replicas", scorecard.GradeWarning)
}

func TestServiceTargetsDeploymentReplicasNok1(t *testing.T) {
t.Parallel()
testExpectedScoreWithConfig(t, []ks.NamedReader{testFile("service-target-deployment-replica-1.yaml")}, nil, &config.RunConfiguration{
MinReplicasDeployment: 1,
}, "Deployment Replicas", scorecard.GradeAllOK)
}

func TestServiceTargetsDeploymentReplicasNok5(t *testing.T) {
t.Parallel()
testExpectedScoreWithConfig(t, []ks.NamedReader{testFile("service-target-deployment-replica-1.yaml")}, nil, &config.RunConfiguration{
MinReplicasDeployment: 5,
}, "Deployment Replicas", scorecard.GradeWarning)
}

func TestHPATargetsDeployment(t *testing.T) {
t.Parallel()
assert.True(t, wasSkipped(t,
Expand Down

0 comments on commit e8566e3

Please sign in to comment.