Skip to content

Commit

Permalink
revise test case
Browse files Browse the repository at this point in the history
Signed-off-by: Shane <[email protected]>
  • Loading branch information
ctccxxd committed Dec 7, 2024
1 parent 5256fb1 commit c52d955
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apis/keda/v1alpha1/scaledobject_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,17 @@ var _ = It("shouldn't validate the so creation when the fallback is wrong", func
})

var _ = It("should validate the so creation When the fallback are configured and the scaler is either CPU or memory.", func() {
namespaceName := "wrong-fallback-cpu-memory"
namespaceName := "right-fallback-cpu-memory"
namespace := createNamespace(namespaceName)
workload := createDeployment(namespaceName, true, true)
so := createScaledObject(soName, namespaceName, workloadName, "apps/v1", "Deployment", true, map[string]string{}, "")
so.Spec.Fallback = &Fallback{
FailureThreshold: 3,
Replicas: 6,
}
for _, trigger := range so.Spec.Triggers {
trigger.MetricType = "AverageValue"
}
err := k8sClient.Create(context.Background(), namespace)
Expect(err).ToNot(HaveOccurred())

Expand Down

0 comments on commit c52d955

Please sign in to comment.