-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
convert some jobs to Ginkgo --label-filter #32911
Comments
/sig testing |
/cc @BenTheElder |
@carlory it will be super useful to write some notes on how to perform the migration, so we document it and achieve some consistency to avoid different groups to end with different solutions to the same problem |
Here's a proposal. @carlory: if this looks good, copy it into the description to ensure that it remains visible?
|
@BenTheElder and I discussed this again at KubeCon NA. He suggested creating an issue with instructions and links to example PRs. Now I remembered that we already have this one here. All it misses are the examples. I noticed that I have permission to edit the description, so I went ahead and directly added some examples there. @carlory, @BenTheElder: can you check the updated issue description? When you are done, I can notify leads and potential contributors that this is something that we want to tackle in 1.33. |
@pohly To achieve it, we also need to change the k/k repo because most tests are not using Step 1: change the k/k repo to use Todo items of this issue seems only include step 2. |
We will do this
but final expected result is:
Is it right? |
Correct, that is the goal. I added one sentence about this: "Replacing [Feature:xxx] with [FeatureGates:xxx] is not part of this issue. Test owners need to do that once this issue is resolved to take advantage of the generic jobs."
Presumably this is a SIG Storage job which runs tests for features which only depend on feature gates. This looks correct to me. Just note that these tests then also should run in the generic jobs. You probably won't need the separate job anymore. We'll have to work with SIG Testing and SIG Release to ensure that those generic jobs are properly monitored. |
Why we need this change:
Filtering tests via
--label-filter
is more readable and easier to review.--label-filter
can specify an allow-list of features supported by a job. When adding new tests which depend on a new feature, they don't accidentally run and fail in existing jobs, as they do now when the SKIP regexp doesn't get updated in lockstep.As soon as all active jobs are converted and use the
--label-filter=Feature: isEmpty
expression or some variant of it, we can remove the requirement that a test which depends only on feature gates must have a[Feature:<xxx>]
tag in addition to[FeatureGate:<xxx>]
(this blocked PR makes such a change). WithFeatureGate automatically addsAlpha
orBeta
to the set of required features, so they still get skipped unless a job explicitly allows them.At that point we can run tests from different SIGs in the shared alpha/beta jobs (pull-kubernetes-kind-alpha-features, pull-kubernetes-kind-beta-features, pull-kubernetes-e2e-kind-alpha-beta-features, kind-master-alpha, kind-master-beta, kind-master-alpha-beta) without having to constantly update those jobs.
Replacing
[Feature:xxx]
with[FeatureGates:xxx]
is not part of this issue. Test owners need to do that once this issue is resolved to take advantage of the generic jobs.Some background references:
Example PRs:
e2e_node
wrong, see below for final versionExamples:
e2e_node
job:test-infra/config/jobs/kubernetes/sig-node/dynamic-resource-allocation.yaml
Line 142 in 4b0c6c4
e2e
jobs:test-infra/config/jobs/kubernetes/sig-testing/kubernetes-kind.yaml
Lines 74 to 75 in 4b0c6c4
test-infra/config/jobs/kubernetes/sig-testing/kubernetes-kind.yaml
Lines 357 to 362 in 4b0c6c4
How to do it
Some tips for figuring out how to replace
--focus/skip
with--label-filter
:go test -v ./test/e2e -args -list-tests
(same fore2e_node
) shows all tests.[]
are also labels. Only those listed bygo test -v ./test/e2e -args -list-labels
are proper labels. If you find that you need to filter by something that isn't a label yet, then replace the inline text withWithLabel
._output/bin/ginkgo --dry-run [--focus/skip/label-filter=...] ./test/e2e
can be used to compare how many and, when adding-v
, which tests would run. Note that statistics for actual runs may differ when tests ask to be skipped when invoked. (install ginkgo viamake ginkgo
)If a job has a "canary" version, update that version first and try it out.
When converting some real jobs:
Related-to: ...
(notFixes: ...
!).After converting a pre-submit job successfully, do the same for the corresponding periodic job.
Some best practices:
TODO(bentheelder): reduce the skip list further
, check whether any of those skip entries really are still needed. Typically those are out-dated workarounds for know issues which got resolved already long ago. Skipping tests by name should not be needed anymore.!Flaky
even if you currently don't have flaky tests. Having it in the jobs is convenient when some tests turns out to be problematic and needs to be disable temporarily.Feature: isEmpty
.Feature: containsAny <my feature> && Feature: isSubsetOf <my feature>
runs tests with have the<my feature>
label and no other unknown features. Use this in dedicated jobs for that feature. Note that e2e_node usesNodeFeature
for the same purpose.!Serial
when runningginkgo -p
and there is no need for separate serial/parallel jobs.!Slow
and!Serial
in pre-submits and only run the skipped tests in periodic jobs.What should be cleaned up or changed:
The text was updated successfully, but these errors were encountered: