Skip to content

Commit a76ac77

Browse files
committed
UPSTREAM: <carry>: Enable VolumeAttributesClass tests in tech preview
The tests need VolumeAttributesClass feature gate enabled. Use `[OCPFeatureGate:]` to enable them in TP jobs and disable them in all other jobs.
1 parent 10466b2 commit a76ac77

File tree

5 files changed

+60
-32
lines changed

5 files changed

+60
-32
lines changed

openshift-hack/cmd/k8s-tests-ext/disabled_tests.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func filterOutDisabledSpecs(specs et.ExtensionTestSpecs) et.ExtensionTestSpecs {
1818
"[Feature:UserNamespacesPodSecurityStandards]",
1919
"[Feature:UserNamespacesSupport]", // disabled Beta
2020
"[Feature:DynamicResourceAllocation]",
21-
"[Feature:VolumeAttributesClass]", // disabled Beta
2221
"[sig-cli] Kubectl client Kubectl prune with applyset should apply and prune objects", // Alpha feature since k8s 1.27
2322
// 4.19
2423
"[Feature:PodLevelResources]",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import (
4+
"strings"
5+
6+
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
7+
)
8+
9+
var (
10+
techPreviewFeatureGates = []string{
11+
"VolumeAttributesClass", // Kubernetes beta, disabled by default
12+
}
13+
)
14+
15+
// Explicitly copy [FeatureGate:xyz] to [OCPFeatureGate:xyz] for feature gates
16+
// that are enabled in TechPreview jobs and disabled otherwise.
17+
// openshift-tests already recognizes [OCPFeatureGate:xyz] and will run the test only
18+
// if the feature gate is enabled in OCP API.
19+
func copyTechPreviewFeatureGates(specs et.ExtensionTestSpecs) {
20+
specs.Walk(func(spec *et.ExtensionTestSpec) {
21+
for _, featureGate := range techPreviewFeatureGates {
22+
upstreamAnnotation := "[FeatureGate:" + featureGate + "]"
23+
if strings.Contains(spec.Name, upstreamAnnotation) {
24+
spec.Name += " [OCPFeatureGate:" + featureGate + "]"
25+
}
26+
}
27+
})
28+
}

openshift-hack/cmd/k8s-tests-ext/k8s-tests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func main() {
114114
})
115115
}
116116

117+
copyTechPreviewFeatureGates(specs)
118+
117119
specs = filterOutDisabledSpecs(specs)
118120
addLabelsToSpecs(specs)
119121

0 commit comments

Comments
 (0)