Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions system_tests/binding_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ var _ = Describe("Binding", func() {

By("updating status condition 'Ready'")
updatedBinding := topology.Binding{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: binding.Name, Namespace: binding.Namespace}, &updatedBinding)).To(Succeed())

Expect(updatedBinding.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: binding.Name, Namespace: binding.Namespace}, &updatedBinding)).To(Succeed())
return updatedBinding.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Binding status condition should be present")

readyCondition := updatedBinding.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
9 changes: 6 additions & 3 deletions system_tests/exchange_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var _ = Describe("Exchange", func() {
var err error
exchangeInfo, err = rabbitClient.GetExchange(exchange.Spec.Vhost, exchange.Name)
return err
}, 10, 2).Should(BeNil())
}, waitUpdatedStatusCondition, 2).Should(BeNil())

Expect(*exchangeInfo).To(MatchFields(IgnoreExtras, Fields{
"Name": Equal(exchange.Spec.Name),
Expand All @@ -66,9 +66,12 @@ var _ = Describe("Exchange", func() {

By("updating status condition 'Ready'")
fetched := topology.Exchange{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: exchange.Name, Namespace: exchange.Namespace}, &fetched)).To(Succeed())

Expect(fetched.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: exchange.Name, Namespace: exchange.Namespace}, &fetched)).To(Succeed())
return fetched.Status.Conditions
}, 20, 2).Should(HaveLen(1), "Exchange status condition should be present")

readyCondition := fetched.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
6 changes: 5 additions & 1 deletion system_tests/federation_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ var _ = Describe("federation", func() {
updatedFederation := topology.Federation{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: federation.Name, Namespace: federation.Namespace}, &updatedFederation)).To(Succeed())

Expect(updatedFederation.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: federation.Name, Namespace: federation.Namespace}, &updatedFederation)).To(Succeed())
return updatedFederation.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Federation status condition should be present")

readyCondition := updatedFederation.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
7 changes: 5 additions & 2 deletions system_tests/permissions_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,12 @@ var _ = Describe("Permission", func() {

By("updating status condition 'Ready'")
updatedPermission := topology.Permission{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: permission.Name, Namespace: permission.Namespace}, &updatedPermission)).To(Succeed())

Expect(updatedPermission.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: permission.Name, Namespace: permission.Namespace}, &updatedPermission)).To(Succeed())
return updatedPermission.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Permission status condition should be present")

readyCondition := updatedPermission.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
7 changes: 5 additions & 2 deletions system_tests/policy_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ var _ = Describe("Policy", func() {

By("updating status condition 'Ready'")
updatedPolicy := topology.Policy{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: policy.Name, Namespace: policy.Namespace}, &updatedPolicy)).To(Succeed())

Expect(updatedPolicy.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: policy.Name, Namespace: policy.Namespace}, &updatedPolicy)).To(Succeed())
return updatedPolicy.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Policy status condition should be present")

readyCondition := updatedPolicy.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
7 changes: 5 additions & 2 deletions system_tests/queue_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ var _ = Describe("Queue Controller", func() {

By("updating status condition 'Ready'")
updatedQueue := topology.Queue{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: q.Name, Namespace: q.Namespace}, &updatedQueue)).To(Succeed())

Expect(updatedQueue.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: q.Name, Namespace: q.Namespace}, &updatedQueue)).To(Succeed())
return updatedQueue.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Queue status condition should be present")

readyCondition := updatedQueue.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
2 changes: 1 addition & 1 deletion system_tests/rabbitmq_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("RabbitMQ connection using provided connection secret", func()
var err error
qInfo, err = rabbitClient.GetQueue("/", q.Name)
return err
}, 10, 2).Should(BeNil())
}, 20, 2).Should(BeNil())

Expect(qInfo.Name).To(Equal(q.Name))
Expect(qInfo.Vhost).To(Equal("/"))
Expand Down
7 changes: 5 additions & 2 deletions system_tests/schema_replication_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ var _ = Describe("schema replication", func() {

By("updating status condition 'Ready'")
updatedReplication := topology.SchemaReplication{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: replication.Name, Namespace: replication.Namespace}, &updatedReplication)).To(Succeed())

Expect(updatedReplication.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: replication.Name, Namespace: replication.Namespace}, &updatedReplication)).To(Succeed())
return updatedReplication.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Schema Replication status condition should be present")

readyCondition := updatedReplication.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
7 changes: 5 additions & 2 deletions system_tests/shovel_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ var _ = Describe("Shovel", func() {

By("updating status condition 'Ready'")
updatedShovel := topology.Shovel{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: shovel.Name, Namespace: shovel.Namespace}, &updatedShovel)).To(Succeed())

Expect(updatedShovel.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: shovel.Name, Namespace: shovel.Namespace}, &updatedShovel)).To(Succeed())
return updatedShovel.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Shovel status condition should be present")

readyCondition := updatedShovel.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
2 changes: 1 addition & 1 deletion system_tests/tls_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var _ = Describe("RabbitMQ Cluster with TLS enabled", func() {
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: policy.Name, Namespace: policy.Namespace}, &fetchedPolicy)).To(Succeed())
return fetchedPolicy.Status.Conditions
}, 10, 2).Should(HaveLen(1))
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "policy status condition should be present")

readyCondition := fetchedPolicy.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expand Down
6 changes: 5 additions & 1 deletion system_tests/user_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ var _ = Describe("Users", func() {
updatedUser := topology.User{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: user.Name, Namespace: user.Namespace}, &updatedUser)).To(Succeed())

Expect(updatedUser.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: user.Name, Namespace: user.Namespace}, &updatedUser)).To(Succeed())
return updatedUser.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "User status condition should be present")

readyCondition := updatedUser.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down
4 changes: 4 additions & 0 deletions system_tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"time"

"sigs.k8s.io/controller-runtime/pkg/client"

Expand All @@ -27,6 +28,9 @@ import (
"k8s.io/utils/pointer"
)

// Useful for small Openshift environment while updating status takes a long time
const waitUpdatedStatusCondition = 20 * time.Second

func createRestConfig() (*rest.Config, error) {
var config *rest.Config
var err error
Expand Down
7 changes: 5 additions & 2 deletions system_tests/vhost_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ var _ = Describe("vhost", func() {

By("updating status condition 'Ready'")
updatedVhost := topology.Vhost{}
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: vhost.Name, Namespace: vhost.Namespace}, &updatedVhost)).To(Succeed())

Expect(updatedVhost.Status.Conditions).To(HaveLen(1))
Eventually(func() []topology.Condition {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: vhost.Name, Namespace: vhost.Namespace}, &updatedVhost)).To(Succeed())
return updatedVhost.Status.Conditions
}, waitUpdatedStatusCondition, 2).Should(HaveLen(1), "Vhost status condition should be present")

readyCondition := updatedVhost.Status.Conditions[0]
Expect(string(readyCondition.Type)).To(Equal("Ready"))
Expect(readyCondition.Status).To(Equal(corev1.ConditionTrue))
Expand Down