Skip to content

Commit

Permalink
Cleanup: rename ExpectedClusterQueueToBeDeleted
Browse files Browse the repository at this point in the history
Signed-off-by: kerthcet <kerthcet@gmail.com>
  • Loading branch information
kerthcet committed Jul 19, 2022
1 parent 93041af commit d0ed166
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/controller/core/workload_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
22 changes: 11 additions & 11 deletions test/integration/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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())
})
Expand Down Expand Up @@ -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())
})
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -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)
})

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit d0ed166

Please sign in to comment.