Skip to content

Commit 0ee146e

Browse files
committed
Fix invalid metric name in unit test
1 parent 1a26b3e commit 0ee146e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

staging/src/k8s.io/component-base/metrics/testutil/testutil_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ func TestNewFakeKubeRegistry(t *testing.T) {
2727
registryVersion := "1.18.0"
2828
counter := metrics.NewCounter(
2929
&metrics.CounterOpts{
30-
Name: "test_counter_name",
30+
Name: "test_normal_total",
3131
Help: "counter help",
3232
},
3333
)
3434
deprecatedCounter := metrics.NewCounter(
3535
&metrics.CounterOpts{
36-
Name: "test_deprecated_counter",
36+
Name: "test_deprecated_total",
3737
Help: "counter help",
3838
DeprecatedVersion: "1.18.0",
3939
},
@@ -55,18 +55,18 @@ func TestNewFakeKubeRegistry(t *testing.T) {
5555
name: "normal",
5656
metric: counter,
5757
expected: `
58-
# HELP test_counter_name [ALPHA] counter help
59-
# TYPE test_counter_name counter
60-
test_counter_name 0
58+
# HELP test_normal_total [ALPHA] counter help
59+
# TYPE test_normal_total counter
60+
test_normal_total 0
6161
`,
6262
},
6363
{
6464
name: "deprecated",
6565
metric: deprecatedCounter,
6666
expected: `
67-
# HELP test_deprecated_counter [ALPHA] (Deprecated since 1.18.0) counter help
68-
# TYPE test_deprecated_counter counter
69-
test_deprecated_counter 0
67+
# HELP test_deprecated_total [ALPHA] (Deprecated since 1.18.0) counter help
68+
# TYPE test_deprecated_total counter
69+
test_deprecated_total 0
7070
`,
7171
},
7272
{

0 commit comments

Comments
 (0)