Skip to content

Commit

Permalink
Properly clean-up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roothorp committed Aug 7, 2023
1 parent 567347f commit 384727b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions test/int/datafederation_protect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,24 @@ var _ = Describe("AtlasProject", Label("int", "AtlasDataFederation", "protection
Expect(k8sClient.Delete(context.Background(), &connectionSecret)).To(Succeed())
})

By("Stopping the operator", func() {
stopManager()
err := k8sClient.Delete(context.Background(), testNamespace)
Expect(err).ToNot(HaveOccurred())
})

By("Removing Atlas Project "+testProject.Status.ID, func() {
Expect(k8sClient.Delete(context.Background(), testProject)).To(Succeed())
Eventually(checkAtlasProjectRemoved(testProject.Status.ID), 60, interval).Should(BeTrue())
})

if !manualDeletion {
By("Removing Atlas DataFederation "+testDataFederationName, func() {
_, err := atlasClient.DataFederation.Delete(context.Background(), testProject.ID(), testDataFederation.Spec.Name)
Expect(err).To(BeNil())
})
}

By("Removing Atlas Project "+testProject.Status.ID, func() {
_, err := atlasClient.Projects.Delete(context.Background(), testProject.ID())
Expect(err).To(BeNil())
})

By("Stopping the operator", func() {
stopManager()
err := k8sClient.Delete(context.Background(), testNamespace)
Expect(err).ToNot(HaveOccurred())
})

})

Describe("Operator is running with deletion protection enabled", func() {
Expand Down Expand Up @@ -126,6 +127,7 @@ var _ = Describe("AtlasProject", Label("int", "AtlasDataFederation", "protection
atlasDataFederation, _, err := atlasClient.DataFederation.Get(context.Background(), testProject.ID(), testDataFederationName)
g.Expect(err).To(BeNil())
g.Expect(atlasDataFederation).ToNot(BeNil())
g.Expect(atlasDataFederation.State).Should(Equal("ACTIVE"))
}).WithTimeout(15 * time.Minute).WithPolling(PollingInterval).Should(Succeed())
})

Expand Down

0 comments on commit 384727b

Please sign in to comment.