Skip to content

Commit 4e13e7a

Browse files
committed
Clean up after tests.
1 parent a63c258 commit 4e13e7a

6 files changed

+24
-0
lines changed

system_tests/exchange_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ var _ = Describe("Exchange", func() {
4444
}
4545
})
4646

47+
AfterEach(func() {
48+
k8sClient.Delete(ctx, exchange)
49+
})
50+
4751
It("declares and deletes a exchange successfully", func() {
4852
By("declaring exchange")
4953
Expect(k8sClient.Create(ctx, exchange, &client.CreateOptions{})).To(Succeed())

system_tests/operatorpolicy_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ var _ = Describe("OperatorPolicy", func() {
4444
}
4545
})
4646

47+
AfterEach(func() {
48+
k8sClient.Delete(ctx, policy)
49+
})
50+
4751
It("creates, updates and deletes an operator policy successfully", func() {
4852
By("creating operator policy")
4953
Expect(k8sClient.Create(ctx, policy, &client.CreateOptions{})).To(Succeed())

system_tests/policy_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ var _ = Describe("Policy", func() {
4343
}
4444
})
4545

46+
AfterEach(func() {
47+
k8sClient.Delete(ctx, policy)
48+
})
49+
4650
It("creates, updates and deletes a policy successfully", func() {
4751
By("creating policy")
4852
Expect(k8sClient.Create(ctx, policy, &client.CreateOptions{})).To(Succeed())

system_tests/queue_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ var _ = Describe("Queue Controller", func() {
4444
}
4545
})
4646

47+
AfterEach(func() {
48+
k8sClient.Delete(ctx, q)
49+
})
50+
4751
It("declares and deletes a queue successfully", func() {
4852
By("declaring queue")
4953
Expect(k8sClient.Create(ctx, q, &client.CreateOptions{})).To(Succeed())

system_tests/user_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ var _ = Describe("Users", func() {
2222
user *topology.User
2323
)
2424

25+
AfterEach(func() {
26+
k8sClient.Delete(ctx, user)
27+
})
28+
2529
When("relying on the operator to generate a username and password", func() {
2630
BeforeEach(func() {
2731
user = &topology.User{

system_tests/vhost_system_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ var _ = Describe("vhost", func() {
3838
}
3939
})
4040

41+
AfterEach(func() {
42+
k8sClient.Delete(ctx, vhost)
43+
})
44+
4145
It("creates and deletes a vhost successfully", func() {
4246
By("creating a vhost")
4347
Expect(k8sClient.Create(ctx, vhost, &client.CreateOptions{})).To(Succeed())

0 commit comments

Comments
 (0)