tests: add special case for metric
`kubevirt_vmi_phase_count` has special labels, and the tests
should take this into account.
@@ -304,12 +304,17 @@ var _ = Describe("Infrastructure", func() {
for _, key := range keys {
// we don't care about the ordering of the labels
// TODO: vmi.Status.NodeName is "" sometimes. Are we faster than the update?
+ if strings.HasPrefix(key, "kubevirt_vmi_phase_count") {
+ // special case: namespace and name don't make sense for this metric
+ Expect(key).To(ContainSubstring(`node="%s"`, nodeName))
+ } else {
Expect(key).To(SatisfyAll(
ContainSubstring(`node="%s"`, nodeName),
ContainSubstring(`namespace="%s"`, vmi.Namespace),
ContainSubstring(`name="%s"`, vmi.Name),
))
}
+ }
}, 300)
It("should include VMI phase metrics for few running VMs", func() {
