File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
pkg/kubelet/metrics/collectors Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ go_test(
30
30
"//pkg/kubelet/server/stats/testing:go_default_library" ,
31
31
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library" ,
32
32
"//staging/src/k8s.io/component-base/metrics/testutil:go_default_library" ,
33
- "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library" ,
34
33
],
35
34
)
36
35
Original file line number Diff line number Diff line change @@ -20,25 +20,19 @@ import (
20
20
"strings"
21
21
"testing"
22
22
23
- "github.com/prometheus/client_golang/prometheus"
24
-
25
23
"k8s.io/component-base/metrics/testutil"
26
24
statsapi "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
27
25
)
28
26
29
27
func TestNoMetricsCollected (t * testing.T ) {
30
- ch := make (chan prometheus.Metric )
31
-
32
28
collector := & logMetricsCollector {
33
29
podStats : func () ([]statsapi.PodStats , error ) {
34
30
return []statsapi.PodStats {}, nil
35
31
},
36
32
}
37
- collector .Collect (ch )
38
33
39
- num := len (ch )
40
- if num != 0 {
41
- t .Fatalf ("Channel expected to be empty, but received %d" , num )
34
+ if err := testutil .CollectAndCompare (collector , strings .NewReader ("" ), "" ); err != nil {
35
+ t .Fatal (err )
42
36
}
43
37
}
44
38
You can’t perform that action at this time.
0 commit comments