Open carlory opened 4 months ago
/sig testing
/assign cc @pohly @aojea
/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?
--focus/skip
with --label-filter
:
go test -v ./test/e2e -args -list-tests
(same for e2e_node
) shows all tests.[]
are also labels. Only those listed by go 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 with WithLabel
._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.Related-to: ...
(not Fixes: ...
!).!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 uses NodeFeature
for the same purpose.!Serial
when running ginkgo -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.
Why we need this change:
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
)When converting some real jobs:
Related-to: ...
(notFixes: ...
!).Some best practices:
!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: