Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: rename ExpectedClusterQueueToBeDeleted #303

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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