Skip to content

Commit 798ce5b

Browse files
committed
e2e framework: add BetaDefaultOff feature gate testcase
1 parent 507621e commit 798ce5b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/e2e/framework/internal/unittests/bugs/bugs.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func Describe() {
8080
framework.WithFeatureGate("no-such-feature-gate"),
8181
framework.WithFeatureGate(features.Alpha),
8282
framework.WithFeatureGate(features.Beta),
83+
framework.WithFeatureGate(features.BetaDefaultOff),
8384
framework.WithFeatureGate(features.GA),
8485
framework.WithConformance(),
8586
framework.WithNodeConformance(),
@@ -116,14 +117,14 @@ ERROR: bugs.go:71: trailing or leading spaces are unnecessary and need to be rem
116117
ERROR: bugs.go:76: WithFeature: unknown feature "no-such-feature"
117118
ERROR: bugs.go:78: WithEnvironment: unknown environment "no-such-env"
118119
ERROR: bugs.go:80: WithFeatureGate: the feature gate "no-such-feature-gate" is unknown
119-
ERROR: bugs.go:106: SIG label must be lowercase, no spaces and no sig- prefix, got instead: "123"
120+
ERROR: bugs.go:107: SIG label must be lowercase, no spaces and no sig- prefix, got instead: "123"
120121
ERROR: buggy/buggy.go:100: hello world
121122
ERROR: some/relative/path/buggy.go:200: with spaces
122123
`
123124
// Used by unittests/list-tests. It's sorted by test name, not source code location.
124125
ListTestsOutput = `The following spec names can be used with 'ginkgo run --focus/skip':
125-
../bugs/bugs.go:100: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [Feature:OffByDefault] [FeatureGate:TestAlphaFeature] [Alpha] [Feature:OffByDefault] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz x [foo] should [bar]
126-
../bugs/bugs.go:95: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [Feature:OffByDefault] [FeatureGate:TestAlphaFeature] [Alpha] [Feature:OffByDefault] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz y [foo] should [bar]
126+
../bugs/bugs.go:101: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [Feature:OffByDefault] [FeatureGate:TestAlphaFeature] [Alpha] [Feature:OffByDefault] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestBetaDefaultOffFeature] [Beta] [Feature:OffByDefault] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz x [foo] should [bar]
127+
../bugs/bugs.go:96: [sig-testing] abc space1 space2 [Feature:no-such-feature] [Feature:feature-foo] [Environment:no-such-env] [Environment:Linux] [FeatureGate:no-such-feature-gate] [Feature:OffByDefault] [FeatureGate:TestAlphaFeature] [Alpha] [Feature:OffByDefault] [FeatureGate:TestBetaFeature] [Beta] [FeatureGate:TestBetaDefaultOffFeature] [Beta] [Feature:OffByDefault] [FeatureGate:TestGAFeature] [Conformance] [NodeConformance] [Slow] [Serial] [Disruptive] [custom-label] xyz y [foo] should [bar]
127128
128129
`
129130

@@ -140,6 +141,7 @@ ERROR: some/relative/path/buggy.go:200: with spaces
140141
Feature:feature-foo
141142
Feature:no-such-feature
142143
FeatureGate:TestAlphaFeature
144+
FeatureGate:TestBetaDefaultOffFeature
143145
FeatureGate:TestBetaFeature
144146
FeatureGate:TestGAFeature
145147
FeatureGate:no-such-feature-gate

test/e2e/framework/internal/unittests/bugs/features/features.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import (
2424
)
2525

2626
const (
27-
Alpha featuregate.Feature = "TestAlphaFeature"
28-
Beta featuregate.Feature = "TestBetaFeature"
29-
GA featuregate.Feature = "TestGAFeature"
27+
Alpha featuregate.Feature = "TestAlphaFeature"
28+
Beta featuregate.Feature = "TestBetaFeature"
29+
BetaDefaultOff featuregate.Feature = "TestBetaDefaultOffFeature"
30+
GA featuregate.Feature = "TestGAFeature"
3031
)
3132

3233
func init() {
@@ -41,6 +42,9 @@ var testFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
4142
{Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha},
4243
{Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta},
4344
},
45+
BetaDefaultOff: {
46+
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta},
47+
},
4448
GA: {
4549
{Version: version.MustParse("1.27"), Default: false, PreRelease: featuregate.Alpha},
4650
{Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta},

0 commit comments

Comments
 (0)