Skip to content

Commit 9ec9135

Browse files
Tests: skip RHACM4K-7518 if no managed cluster (#2022)
This test depends on the managed cluster being correctly added to the testoptions. Therefore we skip the test completetly, if this is not the case. Signed-off-by: Jacob Baungard Hansen <[email protected]>
1 parent c5f5b59 commit 9ec9135

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

tests/pkg/tests/observability_addon_test.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,22 @@ var _ = Describe("", func() {
220220
return utils.UpdateObservabilityFromManagedCluster(testOptions, true)
221221
}, EventuallyTimeoutMinute*5, EventuallyIntervalSecond*5).Should(Succeed())
222222

223-
By("Waiting for MCO addon components ready")
224-
Eventually(func() bool {
225-
err, podList := utils.GetPodList(
226-
testOptions,
227-
false,
228-
MCO_ADDON_NAMESPACE,
229-
"component=metrics-collector",
230-
)
231-
// starting with OCP 4.13, userWorkLoadMonitoring is enabled by default
232-
if len(podList.Items) >= 1 && err == nil {
233-
return true
234-
}
235-
return false
236-
}, EventuallyTimeoutMinute*5, EventuallyIntervalSecond*5).Should(BeTrue())
223+
if len(testOptions.ManagedClusters) > 0 {
224+
By("Waiting for MCO addon components ready")
225+
Eventually(func() bool {
226+
err, podList := utils.GetPodList(
227+
testOptions,
228+
false,
229+
MCO_ADDON_NAMESPACE,
230+
"component=metrics-collector",
231+
)
232+
// starting with OCP 4.13, userWorkLoadMonitoring is enabled by default
233+
if len(podList.Items) >= 1 && err == nil {
234+
return true
235+
}
236+
return false
237+
}, EventuallyTimeoutMinute*5, EventuallyIntervalSecond*5).Should(BeTrue())
238+
}
237239
})
238240
},
239241
)

0 commit comments

Comments
 (0)