lib/promscrape/discovery/kubernetes: deflake tests; a follow-up for 05fb08713c

This commit is contained in:
Aliaksandr Valialkin 2021-03-01 14:31:28 +02:00
parent 62ebf5c88e
commit 1a3689af9a
5 changed files with 5 additions and 10 deletions

View file

@ -1,7 +1,6 @@
package kubernetes
import (
"reflect"
"testing"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
@ -107,7 +106,7 @@ func TestParseEndpointsListSuccess(t *testing.T) {
"__meta_kubernetes_namespace": "default",
}),
}
if !reflect.DeepEqual(sortedLabelss, expectedLabelss) {
if !areEqualLabelss(sortedLabelss, expectedLabelss) {
t.Fatalf("unexpected labels:\ngot\n%v\nwant\n%v", sortedLabelss, expectedLabelss)
}
}

View file

@ -1,7 +1,6 @@
package kubernetes
import (
"reflect"
"testing"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
@ -282,7 +281,7 @@ func TestParseEndpointSliceListSuccess(t *testing.T) {
"__meta_kubernetes_namespace": "kube-system",
}),
}
if !reflect.DeepEqual(sortedLabelss, expectedLabelss) {
if !areEqualLabelss(sortedLabelss, expectedLabelss) {
t.Fatalf("unexpected labels,\ngot:\n%v,\nwant:\n%v", sortedLabelss, expectedLabelss)
}

View file

@ -1,7 +1,6 @@
package kubernetes
import (
"reflect"
"testing"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
@ -92,7 +91,7 @@ func TestParseIngressListSuccess(t *testing.T) {
"__meta_kubernetes_namespace": "default",
}),
}
if !reflect.DeepEqual(sortedLabelss, expectedLabelss) {
if !areEqualLabelss(sortedLabelss, expectedLabelss) {
t.Fatalf("unexpected labels:\ngot\n%v\nwant\n%v", sortedLabelss, expectedLabelss)
}
}

View file

@ -1,7 +1,6 @@
package kubernetes
import (
"reflect"
"testing"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
@ -274,7 +273,7 @@ func TestParsePodListSuccess(t *testing.T) {
"__meta_kubernetes_pod_annotationpresent_kubernetes_io_config_source": "true",
}),
}
if !reflect.DeepEqual(sortedLabelss, expectedLabelss) {
if !areEqualLabelss(sortedLabelss, expectedLabelss) {
t.Fatalf("unexpected labels:\ngot\n%v\nwant\n%v", sortedLabelss, expectedLabelss)
}
}

View file

@ -1,7 +1,6 @@
package kubernetes
import (
"reflect"
"testing"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal"
@ -169,7 +168,7 @@ func TestParseServiceListSuccess(t *testing.T) {
"__meta_kubernetes_service_annotationpresent_prometheus_io_scrape": "true",
}),
}
if !reflect.DeepEqual(sortedLabelss, expectedLabelss) {
if !areEqualLabelss(sortedLabelss, expectedLabelss) {
t.Fatalf("unexpected labels:\ngot\n%v\nwant\n%v", sortedLabelss, expectedLabelss)
}
}