diff --git a/test/suites/webhooks/suite_test.go b/test/suites/webhooks/suite_test.go index ec1639672f55..bd2a9331e9ed 100644 --- a/test/suites/webhooks/suite_test.go +++ b/test/suites/webhooks/suite_test.go @@ -25,11 +25,8 @@ import ( karptest "sigs.k8s.io/karpenter/pkg/test" - "github.com/aws/karpenter-provider-aws/pkg/test" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - . "sigs.k8s.io/karpenter/pkg/test/expectations" . "sigs.k8s.io/karpenter/pkg/utils/testing" ) @@ -38,7 +35,7 @@ var env *aws.Environment var nodeClass *v1beta1.EC2NodeClass var nodePool *karpv1beta1.NodePool -func TestWebhook(t *testing.T) { +func TestWebhooks(t *testing.T) { RegisterFailHandler(Fail) ctx = TestContextWithLogger(t) @@ -48,7 +45,7 @@ func TestWebhook(t *testing.T) { AfterSuite(func() { env.Stop() }) - RunSpecs(t, "Webhook") + RunSpecs(t, "Webhooks") } var _ = BeforeEach(func() { @@ -56,13 +53,14 @@ var _ = BeforeEach(func() { nodeClass = env.DefaultEC2NodeClass() nodePool = env.DefaultNodePool(nodeClass) }) +var _ = AfterEach(func() { env.Cleanup() }) +var _ = AfterEach(func() { env.AfterEach() }) -var _ = Describe("Webhook", func() { +var _ = Describe("Webhooks", func() { It("should schedule pods when webhooks are disabled", func() { - nodeClass := test.EC2NodeClass() - env.ExpectCreated(nodeClass, nodePool) - ExpectApplied(ctx, env.Client, nodePool, nodeClass) - pod := karptest.UnschedulablePod() - ExpectScheduled(ctx, env.Client, pod) + pod := karptest.Pod() + env.ExpectCreated(pod, nodeClass, nodePool) + env.EventuallyExpectHealthy(pod) + env.ExpectCreatedNodeCount("==", 1) }) })