Skip to content

Commit

Permalink
remove the unnecessary test function (#1018)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Zhang <[email protected]>
  • Loading branch information
ryanzhang-oss and Ryan Zhang authored Jan 17, 2025
1 parent 04da89b commit 53d9ae2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
39 changes: 0 additions & 39 deletions test/e2e/placement_eviction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -330,9 +327,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -402,9 +396,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -474,9 +465,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -555,9 +543,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickAll C
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("add taint to member cluster 1", func() {
Expand Down Expand Up @@ -658,9 +643,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -754,9 +736,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("add taint to member cluster 1", func() {
Expand Down Expand Up @@ -870,9 +849,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -969,9 +945,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -1064,9 +1037,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -1160,9 +1130,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("add taint to member cluster 1", func() {
Expand Down Expand Up @@ -1276,9 +1243,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down Expand Up @@ -1375,9 +1339,6 @@ var _ = Describe("ClusterResourcePlacement eviction of bound binding - PickN CRP
},
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Eventually(ensureCRPDisruptionBudgetExists, eventuallyDuration, eventuallyInterval).Should(BeTrue(), "Failed to ensure CRP Disruption Budget exists")
})

It("create cluster resource placement eviction targeting member cluster 1", func() {
Expand Down
11 changes: 0 additions & 11 deletions test/e2e/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,17 +928,6 @@ func ensureCRPEvictionDeleted(crpEvictionName string) {
Eventually(removedActual, eventuallyDuration, eventuallyInterval).Should(Succeed(), "CRP eviction still exists")
}

func ensureCRPDisruptionBudgetExists(crpDisruptionBudgetName string) func() bool {
return func() bool {
crpdb := &placementv1beta1.ClusterResourcePlacementDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Name: crpDisruptionBudgetName,
},
}
return !k8serrors.IsNotFound(hubClient.Get(ctx, types.NamespacedName{Name: crpdb.Name}, crpdb))
}
}

func ensureCRPDisruptionBudgetDeleted(crpDisruptionBudgetName string) {
crpdb := &placementv1beta1.ClusterResourcePlacementDisruptionBudget{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit 53d9ae2

Please sign in to comment.