-
Notifications
You must be signed in to change notification settings - Fork 42k
e2e framework: test labels #112894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e framework: test labels #112894
Changes from all commits
aa4d2fc
3afdcc0
535ab74
39b6916
f2d3442
19ecf93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright 2021 The Kubernetes Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # This script checks that all E2E test suites are sane, i.e. can be | ||
| # started without an error. | ||
|
|
||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
|
|
||
| KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
| source "${KUBE_ROOT}/hack/lib/init.sh" | ||
| source "${KUBE_ROOT}/hack/lib/util.sh" | ||
|
|
||
| kube::golang::verify_go_version | ||
|
|
||
| cd "${KUBE_ROOT}" | ||
|
|
||
| kube::util::ensure-temp-dir | ||
|
|
||
| for suite in $(git grep -l framework.AfterReadingAllFlags | grep -v -e ^test/e2e/framework -e ^hack | xargs -n 1 dirname | sort -u); do | ||
| # Build a binary and run it in the root directory to get paths that are | ||
| # relative to that instead of the package directory. | ||
| out="" | ||
| if (cd "$suite" && go test -c -o "${KUBE_TEMP}/e2e.bin" .) && out=$("${KUBE_TEMP}/e2e.bin" --list-tests); then | ||
| echo "E2E suite $suite passed." | ||
| else | ||
| echo >&2 "ERROR: E2E test suite invocation failed for $suite." | ||
| # shellcheck disable=SC2001 | ||
| echo "$out" | sed -e 's/^/ /' | ||
| fi | ||
| done |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| /* | ||
| Copyright 2023 The Kubernetes Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| // Package feature contains pre-defined features used by test/e2e and/or | ||
| // test/e2e_node. | ||
| package feature | ||
|
|
||
| import ( | ||
| "k8s.io/kubernetes/test/e2e/framework" | ||
| ) | ||
|
|
||
| var ( | ||
| APIServerIdentity = framework.WithFeature(framework.ValidFeatures.Add("APIServerIdentity")) | ||
| AppArmor = framework.WithFeature(framework.ValidFeatures.Add("AppArmor")) | ||
| BootstrapTokens = framework.WithFeature(framework.ValidFeatures.Add("BootstrapTokens")) | ||
| BoundServiceAccountTokenVolume = framework.WithFeature(framework.ValidFeatures.Add("BoundServiceAccountTokenVolume")) | ||
| CloudProvider = framework.WithFeature(framework.ValidFeatures.Add("CloudProvider")) | ||
| ClusterAutoscalerScalability1 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability1")) | ||
| ClusterAutoscalerScalability2 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability2")) | ||
| ClusterAutoscalerScalability3 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability3")) | ||
| ClusterAutoscalerScalability4 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability4")) | ||
| ClusterAutoscalerScalability5 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability5")) | ||
| ClusterAutoscalerScalability6 = framework.WithFeature(framework.ValidFeatures.Add("ClusterAutoscalerScalability6")) | ||
| ClusterDowngrade = framework.WithFeature(framework.ValidFeatures.Add("ClusterDowngrade")) | ||
| ClusterSizeAutoscalingGpu = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingGpu")) | ||
| ClusterSizeAutoscalingScaleDown = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingScaleDown")) | ||
| ClusterSizeAutoscalingScaleUp = framework.WithFeature(framework.ValidFeatures.Add("ClusterSizeAutoscalingScaleUp")) | ||
| ClusterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("ClusterUpgrade")) | ||
| ComprehensiveNamespaceDraining = framework.WithFeature(framework.ValidFeatures.Add("ComprehensiveNamespaceDraining")) | ||
| CPUManager = framework.WithFeature(framework.ValidFeatures.Add("CPUManager")) | ||
| CustomMetricsAutoscaling = framework.WithFeature(framework.ValidFeatures.Add("CustomMetricsAutoscaling")) | ||
| DeviceManager = framework.WithFeature(framework.ValidFeatures.Add("DeviceManager")) | ||
| DevicePluginProbe = framework.WithFeature(framework.ValidFeatures.Add("DevicePluginProbe")) | ||
| Downgrade = framework.WithFeature(framework.ValidFeatures.Add("Downgrade")) | ||
| DynamicResourceAllocation = framework.WithFeature(framework.ValidFeatures.Add("DynamicResourceAllocation")) | ||
| EphemeralStorage = framework.WithFeature(framework.ValidFeatures.Add("EphemeralStorage")) | ||
| Example = framework.WithFeature(framework.ValidFeatures.Add("Example")) | ||
| ExperimentalResourceUsageTracking = framework.WithFeature(framework.ValidFeatures.Add("ExperimentalResourceUsageTracking")) | ||
| Flexvolumes = framework.WithFeature(framework.ValidFeatures.Add("Flexvolumes")) | ||
| GKENodePool = framework.WithFeature(framework.ValidFeatures.Add("GKENodePool")) | ||
| GPUClusterDowngrade = framework.WithFeature(framework.ValidFeatures.Add("GPUClusterDowngrade")) | ||
| GPUClusterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUClusterUpgrade")) | ||
| GPUDevicePlugin = framework.WithFeature(framework.ValidFeatures.Add("GPUDevicePlugin")) | ||
| GPUMasterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUMasterUpgrade")) | ||
| GPUUpgrade = framework.WithFeature(framework.ValidFeatures.Add("GPUUpgrade")) | ||
| HAMaster = framework.WithFeature(framework.ValidFeatures.Add("HAMaster")) | ||
| HPA = framework.WithFeature(framework.ValidFeatures.Add("HPA")) | ||
| HugePages = framework.WithFeature(framework.ValidFeatures.Add("HugePages")) | ||
| Ingress = framework.WithFeature(framework.ValidFeatures.Add("Ingress")) | ||
| IngressScale = framework.WithFeature(framework.ValidFeatures.Add("IngressScale")) | ||
| InPlacePodVerticalScaling = framework.WithFeature(framework.ValidFeatures.Add("InPlacePodVerticalScaling")) | ||
| IPv6DualStack = framework.WithFeature(framework.ValidFeatures.Add("IPv6DualStack")) | ||
| Kind = framework.WithFeature(framework.ValidFeatures.Add("Kind")) | ||
| KubeletCredentialProviders = framework.WithFeature(framework.ValidFeatures.Add("KubeletCredentialProviders")) | ||
| KubeletSecurity = framework.WithFeature(framework.ValidFeatures.Add("KubeletSecurity")) | ||
| KubeProxyDaemonSetDowngrade = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetDowngrade")) | ||
| KubeProxyDaemonSetUpgrade = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetUpgrade")) | ||
| KubeProxyDaemonSetMigration = framework.WithFeature(framework.ValidFeatures.Add("KubeProxyDaemonSetMigration")) | ||
| LabelSelector = framework.WithFeature(framework.ValidFeatures.Add("LabelSelector")) | ||
| LocalStorageCapacityIsolation = framework.WithFeature(framework.ValidFeatures.Add("LocalStorageCapacityIsolation")) | ||
| LocalStorageCapacityIsolationQuota = framework.WithFeature(framework.ValidFeatures.Add("LocalStorageCapacityIsolationQuota")) | ||
| MasterUpgrade = framework.WithFeature(framework.ValidFeatures.Add("MasterUpgrade")) | ||
| MemoryManager = framework.WithFeature(framework.ValidFeatures.Add("MemoryManager")) | ||
| NEG = framework.WithFeature(framework.ValidFeatures.Add("NEG")) | ||
| NetworkingDNS = framework.WithFeature(framework.ValidFeatures.Add("Networking-DNS")) | ||
| NetworkingIPv4 = framework.WithFeature(framework.ValidFeatures.Add("Networking-IPv4")) | ||
| NetworkingIPv6 = framework.WithFeature(framework.ValidFeatures.Add("Networking-IPv6")) | ||
| NetworkingPerformance = framework.WithFeature(framework.ValidFeatures.Add("Networking-Performance")) | ||
| NetworkPolicy = framework.WithFeature(framework.ValidFeatures.Add("NetworkPolicy")) | ||
| NodeAuthenticator = framework.WithFeature(framework.ValidFeatures.Add("NodeAuthenticator")) | ||
| NodeAuthorizer = framework.WithFeature(framework.ValidFeatures.Add("NodeAuthorizer")) | ||
| NodeOutOfServiceVolumeDetach = framework.WithFeature(framework.ValidFeatures.Add("NodeOutOfServiceVolumeDetach")) | ||
| NoSNAT = framework.WithFeature(framework.ValidFeatures.Add("NoSNAT")) | ||
| PerformanceDNS = framework.WithFeature(framework.ValidFeatures.Add("PerformanceDNS")) | ||
| PodGarbageCollector = framework.WithFeature(framework.ValidFeatures.Add("PodGarbageCollector")) | ||
| PodPriority = framework.WithFeature(framework.ValidFeatures.Add("PodPriority")) | ||
| PodReadyToStartContainersCondition = framework.WithFeature(framework.ValidFeatures.Add("PodReadyToStartContainersCondition")) | ||
| PodResources = framework.WithFeature(framework.ValidFeatures.Add("PodResources")) | ||
| ProbeTerminationGracePeriod = framework.WithFeature(framework.ValidFeatures.Add("ProbeTerminationGracePeriod")) | ||
| Reboot = framework.WithFeature(framework.ValidFeatures.Add("Reboot")) | ||
| ReclaimPolicy = framework.WithFeature(framework.ValidFeatures.Add("ReclaimPolicy")) | ||
| RecoverVolumeExpansionFailure = framework.WithFeature(framework.ValidFeatures.Add("RecoverVolumeExpansionFailure")) | ||
| Recreate = framework.WithFeature(framework.ValidFeatures.Add("Recreate")) | ||
| RegularResourceUsageTracking = framework.WithFeature(framework.ValidFeatures.Add("RegularResourceUsageTracking")) | ||
| ScopeSelectors = framework.WithFeature(framework.ValidFeatures.Add("ScopeSelectors")) | ||
| SCTPConnectivity = framework.WithFeature(framework.ValidFeatures.Add("SCTPConnectivity")) | ||
| SeccompDefault = framework.WithFeature(framework.ValidFeatures.Add("SeccompDefault")) | ||
| SELinux = framework.WithFeature(framework.ValidFeatures.Add("SELinux")) | ||
| SELinuxMountReadWriteOncePod = framework.WithFeature(framework.ValidFeatures.Add("SELinuxMountReadWriteOncePod")) | ||
| StackdriverAcceleratorMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverAcceleratorMonitoring")) | ||
| StackdriverCustomMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverCustomMetrics")) | ||
| StackdriverExternalMetrics = framework.WithFeature(framework.ValidFeatures.Add("StackdriverExternalMetrics")) | ||
| StackdriverMetadataAgent = framework.WithFeature(framework.ValidFeatures.Add("StackdriverMetadataAgent")) | ||
| StackdriverMonitoring = framework.WithFeature(framework.ValidFeatures.Add("StackdriverMonitoring")) | ||
| StandaloneMode = framework.WithFeature(framework.ValidFeatures.Add("StandaloneMode")) | ||
| StatefulSet = framework.WithFeature(framework.ValidFeatures.Add("StatefulSet")) | ||
| StatefulSetStartOrdinal = framework.WithFeature(framework.ValidFeatures.Add("StatefulSetStartOrdinal")) | ||
| StatefulUpgrade = framework.WithFeature(framework.ValidFeatures.Add("StatefulUpgrade")) | ||
| StorageProvider = framework.WithFeature(framework.ValidFeatures.Add("StorageProvider")) | ||
| StorageVersionAPI = framework.WithFeature(framework.ValidFeatures.Add("StorageVersionAPI")) | ||
| TopologyHints = framework.WithFeature(framework.ValidFeatures.Add("Topology Hints")) | ||
| UDP = framework.WithFeature(framework.ValidFeatures.Add("UDP")) | ||
| Upgrade = framework.WithFeature(framework.ValidFeatures.Add("Upgrade")) | ||
| UserNamespacesStatelessPodsSupport = framework.WithFeature(framework.ValidFeatures.Add("UserNamespacesStatelessPodsSupport")) | ||
| ValidatingAdmissionPolicy = framework.WithFeature(framework.ValidFeatures.Add("ValidatingAdmissionPolicy")) | ||
| Volumes = framework.WithFeature(framework.ValidFeatures.Add("Volumes")) | ||
| VolumeSnapshotDataSource = framework.WithFeature(framework.ValidFeatures.Add("VolumeSnapshotDataSource")) | ||
| VolumeSourceXFS = framework.WithFeature(framework.ValidFeatures.Add("VolumeSourceXFS")) | ||
| Vsphere = framework.WithFeature(framework.ValidFeatures.Add("vsphere")) | ||
| WatchList = framework.WithFeature(framework.ValidFeatures.Add("WatchList")) | ||
| Windows = framework.WithFeature(framework.ValidFeatures.Add("Windows")) | ||
| WindowsHostProcessContainers = framework.WithFeature(framework.ValidFeatures.Add("WindowsHostProcessContainers")) | ||
| WindowsHyperVContainers = framework.WithFeature(framework.ValidFeatures.Add("WindowsHyperVContainers")) | ||
| ) | ||
|
|
||
| func init() { | ||
| // This prevents adding additional ad-hoc features in tests. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't have time to go through the whole PR logic, do you mind explain how this prevents that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once this package is done with registering the pre-defined features, it locks the registry. Tests that import this package then cannot add more of them. There is a loophole: a test that doesn't import the package could define features during its own init and, depending on the order in which packages get initialized, might succeed with that. This is only a problem for init. Describe callbacks get invoked after the global init, so something like this will always fail: We can also drop this locking and rely instead on code reviews to prevent a proliferation of arbitrary feature tags. I'm open for suggestions here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. everything that is not automated is doomed to fail XD |
||
| framework.ValidFeatures.Freeze() | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we keep this in sync with the
pkg/features?didn't we talked about using those values directly so tests and feature gates are in sync by code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did, and you said:
This file here is about features, not feature gates (=
pkg/features), and thus intentionally not forced to be in sync.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, you caught me there, I missed that detail, so we call Feature something like NetworkPolicy or Ingress, sorry about that, I stand on my previous position :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should have that separation. But nonetheless it is confusing and we'll need very good guidance in the pending KEP and the framework about when to use
FeatureGateand whenFeature.I also still wonder whether we can come up with a different name than
Feature. It's just too close toFeatureGate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeyKanzhelev you will be interested on this PR, since you started the discussion here https://github.com/kubernetes/enhancements/pull/3042/files#r988729747 :)