Skip to content

Commit

Permalink
Test drpc delete on placementRule delete (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Sheetal Pamecha <[email protected]>
  • Loading branch information
Sheetalpamecha authored Jul 16, 2024
1 parent e4e54e3 commit a8a8231
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions internal/controller/drplacementcontrol_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1852,6 +1852,31 @@ var _ = Describe("DRPlacementControl Reconciler Errors", func() {
}
}, SpecTimeout(time.Second*10))
})
When("a placementRule is deleted", func() {

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)

Check failure on line 1855 in internal/controller/drplacementcontrol_controller_test.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

File is not `gofmt`-ed with `-s` (gofmt)
AfterEach(func() {
err := forceCleanupClusterAfterAErrorTest()
Expect(err).ToNot(HaveOccurred())
})
It("drpc should get deleted", func(ctx SpecContext) {
_, _ = InitialDeploymentAsync(DefaultDRPCNamespace, UserPlacementRuleName, East1ManagedCluster,
UsePlacementRule)
waitForCompletion(string(rmn.Deployed))

deleteUserPlacementRule(UserPlacementRuleName, DefaultDRPCNamespace)

Eventually(func() bool {
drpcLookupKey := types.NamespacedName{
Name: DRPCCommonName,
Namespace: DefaultDRPCNamespace,
}
latestDRPC := &rmn.DRPlacementControl{}

err := apiReader.Get(context.TODO(), drpcLookupKey, latestDRPC)

return errors.IsNotFound(err)
}, timeout, interval).Should(HaveOccurred())
}, SpecTimeout(time.Second*10))
})
})

// +kubebuilder:docs-gen:collapse=Imports
Expand Down

0 comments on commit a8a8231

Please sign in to comment.