Skip to content

Commit ab93364

Browse files
dfajmonjacobsee
authored andcommitted
UPSTREAM: <carry>: Disable tests from featuregates that are not explicitly enabled
1 parent 78dddfc commit ab93364

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ func filterOutDisabledSpecs(specs et.ExtensionTestSpecs) et.ExtensionTestSpecs {
1111
"Alpha": { // alpha features that are not gated
1212
"[Feature:StorageVersionAPI]",
1313
"[Feature:ClusterTrustBundle]",
14-
"[Feature:SELinuxMount]",
15-
"[FeatureGate:SELinuxMount]",
1614
"[Feature:DynamicResourceAllocation]",
17-
"[Feature:VolumeAttributesClass]", // disabled Beta
1815
"[sig-cli] Kubectl client Kubectl prune with applyset should apply and prune objects", // Alpha feature since k8s 1.27
1916
// 4.19
2017
"[Feature:PodLevelResources]",
2118
"[Feature:PodLogsQuerySplitStreams]",
2219
// 4.20
23-
"[Feature:OffByDefault]",
2420
"[Feature:CBOR]",
2521
},
2622
// tests for features that are not implemented in openshift

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"strings"
56

67
et "github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
78
"k8s.io/kubernetes/pkg/features"
@@ -15,6 +16,7 @@ func addEnvironmentSelectors(specs et.ExtensionTestSpecs) {
1516
filterByTopology(specs)
1617
filterByNoOptionalCapabilities(specs)
1718
filterByNetwork(specs)
19+
filterByFeatureGates(specs)
1820

1921
// LoadBalancer tests in 1.31 require explicit platform-specific skips
2022
// https://issues.redhat.com/browse/OCPBUGS-38840
@@ -273,3 +275,15 @@ func filterByNetwork(specs et.ExtensionTestSpecs) {
273275
AddLabel(fmt.Sprintf("[Skipped:%s]", network))
274276
}
275277
}
278+
279+
// filter all tests from feature gates that are not explicitly enabled
280+
func filterByFeatureGates(specs et.ExtensionTestSpecs) {
281+
for _, spec := range specs {
282+
for label := range spec.Labels {
283+
if strings.Contains(label, "FeatureGate:") {
284+
featureGate := strings.TrimPrefix(label, "FeatureGate:")
285+
spec.Exclude(et.FeatureGateDisabled(featureGate))
286+
}
287+
}
288+
}
289+
}

openshift-hack/test-kubernetes-e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ NETWORK_SKIPS="\[Skipped:Network/OVNKubernetes\]|\[Feature:Networking-IPv6\]|\[F
3131
TEST_SUITE="${TEST_SUITE:-parallel}"
3232
COMMON_SKIPS="\[Slow\]|\[Disruptive\]|\[Flaky\]|\[Disabled:.+\]|\[Skipped:${PLATFORM}\]|${NETWORK_SKIPS}"
3333
# Skip tests for features that require a TechPreview cluster. TODO: Remove when the feature is enabled by default.
34-
COMMON_SKIPS="\[OCPFeatureGate:VolumeGroupSnapshot\]|${COMMON_SKIPS}"
34+
COMMON_SKIPS="\[OCPFeatureGate:VolumeGroupSnapshot\]|\[Feature:OffByDefault\]|${COMMON_SKIPS}"
3535

3636
case "${TEST_SUITE}" in
3737
serial)

0 commit comments

Comments
 (0)