fix tests

This commit is contained in:
Han Kang 2023-07-12 11:26:42 -07:00
parent aa788219f4
commit 9189c3d559
2 changed files with 3 additions and 3 deletions

View File

@ -433,7 +433,7 @@ func TestFeatureGateMetrics(t *testing.T) {
const testBetaDisabled Feature = "TestBetaDisabled" const testBetaDisabled Feature = "TestBetaDisabled"
testedMetrics := []string{"kubernetes_feature_enabled"} testedMetrics := []string{"kubernetes_feature_enabled"}
expectedOutput := ` expectedOutput := `
# HELP kubernetes_feature_enabled [ALPHA] This metric records the data about the stage and enablement of a k8s feature. # HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge # TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="TestAlpha",stage="ALPHA"} 0 kubernetes_feature_enabled{name="TestAlpha",stage="ALPHA"} 0
kubernetes_feature_enabled{name="TestBeta",stage="BETA"} 1 kubernetes_feature_enabled{name="TestBeta",stage="BETA"} 1

View File

@ -46,7 +46,7 @@ func TestObserveHealthcheck(t *testing.T) {
stage: "ALPHA", stage: "ALPHA",
enabled: true, enabled: true,
want: ` want: `
# HELP kubernetes_feature_enabled [ALPHA] This metric records the data about the stage and enablement of a k8s feature. # HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge # TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="feature-a",stage="ALPHA"} 1 kubernetes_feature_enabled{name="feature-a",stage="ALPHA"} 1
`, `,
@ -57,7 +57,7 @@ func TestObserveHealthcheck(t *testing.T) {
stage: "BETA", stage: "BETA",
enabled: false, enabled: false,
want: ` want: `
# HELP kubernetes_feature_enabled [ALPHA] This metric records the data about the stage and enablement of a k8s feature. # HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge # TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="feature-b",stage="BETA"} 0 kubernetes_feature_enabled{name="feature-b",stage="BETA"} 0
`, `,