mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Fix invalid metric name in unit test
This commit is contained in:
parent
1a26b3eeb5
commit
0ee146e24f
@ -27,13 +27,13 @@ func TestNewFakeKubeRegistry(t *testing.T) {
|
|||||||
registryVersion := "1.18.0"
|
registryVersion := "1.18.0"
|
||||||
counter := metrics.NewCounter(
|
counter := metrics.NewCounter(
|
||||||
&metrics.CounterOpts{
|
&metrics.CounterOpts{
|
||||||
Name: "test_counter_name",
|
Name: "test_normal_total",
|
||||||
Help: "counter help",
|
Help: "counter help",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
deprecatedCounter := metrics.NewCounter(
|
deprecatedCounter := metrics.NewCounter(
|
||||||
&metrics.CounterOpts{
|
&metrics.CounterOpts{
|
||||||
Name: "test_deprecated_counter",
|
Name: "test_deprecated_total",
|
||||||
Help: "counter help",
|
Help: "counter help",
|
||||||
DeprecatedVersion: "1.18.0",
|
DeprecatedVersion: "1.18.0",
|
||||||
},
|
},
|
||||||
@ -55,18 +55,18 @@ func TestNewFakeKubeRegistry(t *testing.T) {
|
|||||||
name: "normal",
|
name: "normal",
|
||||||
metric: counter,
|
metric: counter,
|
||||||
expected: `
|
expected: `
|
||||||
# HELP test_counter_name [ALPHA] counter help
|
# HELP test_normal_total [ALPHA] counter help
|
||||||
# TYPE test_counter_name counter
|
# TYPE test_normal_total counter
|
||||||
test_counter_name 0
|
test_normal_total 0
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "deprecated",
|
name: "deprecated",
|
||||||
metric: deprecatedCounter,
|
metric: deprecatedCounter,
|
||||||
expected: `
|
expected: `
|
||||||
# HELP test_deprecated_counter [ALPHA] (Deprecated since 1.18.0) counter help
|
# HELP test_deprecated_total [ALPHA] (Deprecated since 1.18.0) counter help
|
||||||
# TYPE test_deprecated_counter counter
|
# TYPE test_deprecated_total counter
|
||||||
test_deprecated_counter 0
|
test_deprecated_total 0
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user