Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed El-Sayed committed Dec 20, 2022
1 parent 888e1cf commit 72416df
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/integration/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,22 @@ func TestIntegration(t *testing.T) {
})

t.Run("test mutate resources", func(t *testing.T) {
raw, err := ioutil.ReadFile("data/resources/mutation_test-resources.yaml")
raw, err := ioutil.ReadFile("data/resources/mutation_test_resources.yaml")
assert.Nil(t, err)

var m map[string]interface{}
err = yaml.Unmarshal(raw, &m)
assert.Nil(t, err)

spec := m["spec"].(map[string]interface{})
assert.Equal(t, spec["replicas"], float64(1))
assert.Equal(t, int64(1), spec["replicas"])

err = kubectl("apply", "-f", "data/resources/mutation_test-resources.yaml")
err = kubectl("apply", "-f", "data/resources/mutation_test_resources.yaml")
assert.NotNil(t, err)

var deployment appsv1.Deployment
err = cl.Get(ctx, client.ObjectKey{Name: testMutationDeployment, Namespace: "default"}, &deployment)
assert.NotNil(t, err)
assert.Nil(t, deployment)

var policy v2beta2.Policy
err = cl.Get(ctx, client.ObjectKey{Name: minimumReplicaCountPolicy}, &policy)
Expand Down

0 comments on commit 72416df

Please sign in to comment.