Skip to content

Commit 07cc2c1

Browse files
committed
UPSTREAM: <carry>: support feature gate filtering from upstream
When considering upstream feature gates, not all are known or present in openshift/api, so we have to be selective about which we filter on. This uses data provided by OTE and an allow list to include/exclude upstream tests. $ k8s-tests-ext list tests --platform aws --feature-gate VolumeAttributesClass |\ jq '.[].name' | grep VolumeAttributesClass | wc -l 30 $ k8s-tests-ext list tests --platform aws |\ jq '.[].name' | grep VolumeAttributesClass | wc -l 0
1 parent 10466b2 commit 07cc2c1

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
5+
56
"k8s.io/apimachinery/pkg/util/sets"
67
)
78

@@ -18,7 +19,6 @@ func filterOutDisabledSpecs(specs et.ExtensionTestSpecs) et.ExtensionTestSpecs {
1819
"[Feature:UserNamespacesPodSecurityStandards]",
1920
"[Feature:UserNamespacesSupport]", // disabled Beta
2021
"[Feature:DynamicResourceAllocation]",
21-
"[Feature:VolumeAttributesClass]", // disabled Beta
2222
"[sig-cli] Kubectl client Kubectl prune with applyset should apply and prune objects", // Alpha feature since k8s 1.27
2323
// 4.19
2424
"[Feature:PodLevelResources]",

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func addEnvironmentSelectors(specs et.ExtensionTestSpecs) {
1414
filterByTopology(specs)
1515
filterByNoOptionalCapabilities(specs)
1616
filterByNetwork(specs)
17+
filterByFeatureGate(specs)
1718

1819
// LoadBalancer tests in 1.31 require explicit platform-specific skips
1920
// https://issues.redhat.com/browse/OCPBUGS-38840
@@ -247,3 +248,14 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
247248
AddLabel(fmt.Sprintf("[Skipped:%s]", network))
248249
}
249250
}
251+
252+
// filterByFeatureGate is a helper to exclude tests that only work when a particular feature gate is enabled
253+
func filterByFeatureGate(specs et.ExtensionTestSpecs) {
254+
techPreviewFeatureGates := []string{
255+
"VolumeAttributesClass", // Kubernetes beta, disabled by default
256+
}
257+
258+
for _, featureGate := range techPreviewFeatureGates {
259+
specs.Select(et.NameContains("[FeatureGate:" + featureGate)).Include(et.FeatureGateEnabled(featureGate))
260+
}
261+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package main

0 commit comments

Comments
 (0)