Skip to content

Commit

Permalink
Fit system test matching error strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunyiLyu committed Apr 28, 2021
1 parent 383c578 commit 8a69cd7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions system_tests/deletion_system_test.go
Expand Up @@ -100,7 +100,7 @@ var _ = Describe("Deletion", func() {
targetCluster.Name,
)
return string(output)
}, 90, 10).Should(ContainSubstring("not found"))
}, 90, 10).Should(ContainSubstring("NotFound"))
By("allowing the topology objects to be deleted")
Expect(k8sClient.Delete(ctx, &exchange)).To(Succeed())
Eventually(func() string {
Expand All @@ -112,7 +112,7 @@ var _ = Describe("Deletion", func() {
exchange.Name,
)
return string(output)
}, 30, 10).Should(ContainSubstring("not found"))
}, 30, 10).Should(ContainSubstring("NotFound"))
Expect(k8sClient.Delete(ctx, &policy)).To(Succeed())
Eventually(func() string {
output, _ := kubectl(
Expand All @@ -123,7 +123,7 @@ var _ = Describe("Deletion", func() {
policy.Name,
)
return string(output)
}, 30, 10).Should(ContainSubstring("not found"))
}, 30, 10).Should(ContainSubstring("NotFound"))
Expect(k8sClient.Delete(ctx, &queue)).To(Succeed())
Eventually(func() string {
output, _ := kubectl(
Expand All @@ -134,7 +134,7 @@ var _ = Describe("Deletion", func() {
queue.Name,
)
return string(output)
}, 30, 10).Should(ContainSubstring("not found"))
}, 30, 10).Should(ContainSubstring("NotFound"))
Expect(k8sClient.Delete(ctx, &user)).To(Succeed())
Eventually(func() string {
output, _ := kubectl(
Expand All @@ -145,7 +145,7 @@ var _ = Describe("Deletion", func() {
user.Name,
)
return string(output)
}, 30, 10).Should(ContainSubstring("not found"))
}, 30, 10).Should(ContainSubstring("NotFound"))
Expect(k8sClient.Delete(ctx, &vhost)).To(Succeed())
Eventually(func() string {
output, _ := kubectl(
Expand All @@ -156,6 +156,6 @@ var _ = Describe("Deletion", func() {
vhost.Name,
)
return string(output)
}, 30, 10).Should(ContainSubstring("not found"))
}, 30, 10).Should(ContainSubstring("NotFound"))
})
})
4 changes: 2 additions & 2 deletions system_tests/tls_system_test.go
Expand Up @@ -62,7 +62,7 @@ var _ = Describe("RabbitmqCluster with TLS", func() {
policy.Name,
)
return string(output)
}, 90, 10).Should(ContainSubstring("not found"))
}, 90, 10).Should(ContainSubstring("NotFound"))
Expect(k8sClient.Delete(ctx, &rabbitmqv1beta1.RabbitmqCluster{ObjectMeta: metav1.ObjectMeta{Name: targetCluster.Name, Namespace: targetCluster.Namespace}})).To(Succeed())
Eventually(func() string {
output, _ := kubectl(
Expand All @@ -73,7 +73,7 @@ var _ = Describe("RabbitmqCluster with TLS", func() {
targetCluster.Name,
)
return string(output)
}, 90, 10).Should(ContainSubstring("not found"))
}, 90, 10).Should(ContainSubstring("NotFound"))
})

It("succeeds creating objects on the TLS-enabled instance", func() {
Expand Down
6 changes: 3 additions & 3 deletions system_tests/utils.go
Expand Up @@ -192,7 +192,7 @@ func setupTestRabbitmqCluster(k8sClient client.Client, rabbitmqCluster *rabbitmq
"-ojsonpath='{.status.conditions[?(@.type==\"AllReplicasReady\")].status}'",
)
if err != nil {
Expect(string(output)).To(ContainSubstring("not found"))
Expect(string(output)).To(ContainSubstring("NotFound"))
}
return string(output)
}, 120, 10).Should(Equal("'True'"))
Expand All @@ -212,7 +212,7 @@ func updateTestRabbitmqCluster(k8sClient client.Client, rabbitmqCluster *rabbitm
"-ojsonpath='{.status.conditions[?(@.type==\"AllReplicasReady\")].status}'",
)
if err != nil {
Expect(string(output)).To(ContainSubstring("not found"))
Expect(string(output)).To(ContainSubstring("NotFound"))
}
return string(output)
}, 120, 10).Should(Equal("'True'"))
Expand Down Expand Up @@ -270,7 +270,7 @@ func k8sSecretExists(secretName, secretNamespace string) (bool, error) {
)

if err != nil {
ExpectWithOffset(1, string(output)).To(ContainSubstring("not found"))
ExpectWithOffset(1, string(output)).To(ContainSubstring("NotFound"))
return false, nil
}

Expand Down

0 comments on commit 8a69cd7

Please sign in to comment.