Letting tests to accept eventually value, rather than strict expectation (#176)

This commit is contained in:
Dario Tranchitella
2020-12-23 10:49:14 +01:00
committed by GitHub
parent 49c8131eb5
commit cb986384db

View File

@@ -70,7 +70,7 @@ var _ = Describe("creating a Namespace for a Tenant with additional metadata", f
Eventually(func() (ok bool) {
Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: ns.GetName()}, ns)).Should(Succeed())
for k, v := range tnt.Spec.NamespacesMetadata.AdditionalLabels {
if ok = Expect(ns.Labels).Should(HaveKeyWithValue(k, v)); !ok {
if ok, _ = HaveKeyWithValue(k, v).Match(ns.Labels); !ok {
return
}
}
@@ -81,7 +81,7 @@ var _ = Describe("creating a Namespace for a Tenant with additional metadata", f
Eventually(func() (ok bool) {
Expect(k8sClient.Get(context.TODO(), types.NamespacedName{Name: ns.GetName()}, ns)).Should(Succeed())
for k, v := range tnt.Spec.NamespacesMetadata.AdditionalAnnotations {
if ok = Expect(ns.Annotations).Should(HaveKeyWithValue(k, v)); !ok {
if ok, _ = HaveKeyWithValue(k, v).Match(ns.Annotations); !ok {
return
}
}