From d0ed166d2bad00fc7004a943d8b7cf4d45344bde Mon Sep 17 00:00:00 2001 From: kerthcet Date: Tue, 19 Jul 2022 14:15:43 +0800 Subject: [PATCH] Cleanup: rename ExpectedClusterQueueToBeDeleted Signed-off-by: kerthcet --- .../core/clusterqueue_controller_test.go | 2 +- .../core/workload_controller_test.go | 4 ++-- test/integration/framework/framework.go | 2 +- test/integration/scheduler/scheduler_test.go | 22 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/integration/controller/core/clusterqueue_controller_test.go b/test/integration/controller/core/clusterqueue_controller_test.go index 320c84f151..bf7dfb219e 100644 --- a/test/integration/controller/core/clusterqueue_controller_test.go +++ b/test/integration/controller/core/clusterqueue_controller_test.go @@ -232,7 +232,7 @@ var _ = ginkgo.Describe("ClusterQueue controller", func() { }) ginkgo.It("Should delete clusterQueues successfully when no admitted workloads are running", func() { - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) }) ginkgo.It("Should stuck in termination until admitted workloads finished running", func() { diff --git a/test/integration/controller/core/workload_controller_test.go b/test/integration/controller/core/workload_controller_test.go index 888097993f..fe660d1a38 100644 --- a/test/integration/controller/core/workload_controller_test.go +++ b/test/integration/controller/core/workload_controller_test.go @@ -171,7 +171,7 @@ var _ = ginkgo.Describe("Workload controller", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) gomega.Expect(framework.DeleteRuntimeClass(ctx, k8sClient, runtimeClass)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, clusterQueue, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, clusterQueue, true) }) ginkgo.It("Should accumulate RuntimeClass's overhead", func() { @@ -216,7 +216,7 @@ var _ = ginkgo.Describe("Workload controller", func() { }) ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, clusterQueue, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, clusterQueue, true) }) ginkgo.It("Should not accumulate RuntimeClass's overhead", func() { diff --git a/test/integration/framework/framework.go b/test/integration/framework/framework.go index 54e541a262..92cd6ff24e 100644 --- a/test/integration/framework/framework.go +++ b/test/integration/framework/framework.go @@ -283,7 +283,7 @@ func UpdateWorkloadStatus(ctx context.Context, k8sClient client.Client, wl *kueu }, Timeout, Interval).Should(gomega.Succeed()) } -func ExpectedClusterQueueToBeDeleted(ctx context.Context, k8sClient client.Client, cq *kueue.ClusterQueue, deleteCq bool) { +func ExpectClusterQueueToBeDeleted(ctx context.Context, k8sClient client.Client, cq *kueue.ClusterQueue, deleteCq bool) { if deleteCq { gomega.Expect(DeleteClusterQueue(ctx, k8sClient, cq)).ToNot(gomega.HaveOccurred()) } diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 48ca71ebc9..853954e398 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -113,8 +113,8 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, prodClusterQ, true) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, devClusterQ, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, prodClusterQ, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, devClusterQ, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, spotTaintedFlavor)).To(gomega.Succeed()) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, spotUntaintedFlavor)).To(gomega.Succeed()) @@ -417,7 +417,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, onDemandFlavor)).To(gomega.Succeed()) }) ginkgo.It("Should re-enqueue by the update event of ClusterQueue", func() { @@ -492,7 +492,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, nsFoo)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) }) @@ -549,7 +549,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, fooCQ, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, fooCQ, true) }) ginkgo.It("Should be inactive until the flavor is created", func() { @@ -597,7 +597,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, spotTaintedFlavor)).To(gomega.Succeed()) }) @@ -661,7 +661,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, spotUntaintedFlavor)).To(gomega.Succeed()) }) @@ -711,7 +711,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, prodBEClusterQ, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, prodBEClusterQ, true) gomega.Expect(framework.DeleteClusterQueue(ctx, k8sClient, devBEClusterQ)).ToNot(gomega.HaveOccurred()) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) gomega.Expect(framework.DeleteResourceFlavor(ctx, k8sClient, spotTaintedFlavor)).To(gomega.Succeed()) @@ -843,7 +843,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) }) @@ -896,7 +896,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, strictFIFOClusterQ, true) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, strictFIFOClusterQ, true) framework.ExpectedResourceFlavorToBeDeleted(ctx, k8sClient, onDemandFlavor, true) }) @@ -936,7 +936,7 @@ var _ = ginkgo.Describe("Scheduler", func() { ginkgo.AfterEach(func() { gomega.Expect(framework.DeleteNamespace(ctx, k8sClient, ns)).To(gomega.Succeed()) - framework.ExpectedClusterQueueToBeDeleted(ctx, k8sClient, cq, false) + framework.ExpectClusterQueueToBeDeleted(ctx, k8sClient, cq, false) }) ginkgo.It("Should not admit new created workloads", func() {