Skip to content
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

Open
21 tasks
carlory opened this issue Jul 5, 2024 · 5 comments
Open
21 tasks

convert some jobs to Ginkgo --label-filter #32911

carlory opened this issue Jul 5, 2024 · 5 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/testing Categorizes an issue or PR as relevant to SIG Testing.

Comments

@carlory
Copy link
Member

carlory commented Jul 5, 2024

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 for e2e_node) shows all tests.
    • Note that not all tags in [] 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. (install ginkgo via make ginkgo)
  • If a job has a "canary" version, update that version first and try it out.

  • When converting some real jobs:

    • Create a separate tracking issue with a link to the jobs' testgrid entry.
    • Convert the job, linking to that issue with Related-to: ... (not Fixes: ...!).
    • Verify that the job still works as intended, then close the issue.
  • After converting a pre-submit job successfully, do the same for the corresponding periodic job.

  • Some best practices:

    • Replace focus/skip completely with a single label-filter.
    • Include !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.
    • Exclude tests with special requirements with 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.
    • Ginkgo can run serial jobs together with parallel ones in a single invocation by running the serial jobs (and only those) sequentially, so it's not absolutely required to use !Serial when running ginkgo -p and there is no need for separate serial/parallel jobs.
    • Beware that serial tests can affect the overall runtime. It might be useful to skip with !Slow and !Serial in pre-submits and only run the skipped tests in periodic jobs.

What should be cleaned up or changed:

@carlory carlory added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jul 5, 2024
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 5, 2024
@carlory
Copy link
Member Author

carlory commented Jul 5, 2024

/sig testing

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 5, 2024
@carlory
Copy link
Member Author

carlory commented Jul 5, 2024

/assign
cc @pohly @aojea

@aojea
Copy link
Member

aojea commented Jul 5, 2024

/cc @BenTheElder

@aojea
Copy link
Member

aojea commented Jul 29, 2024

@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

@pohly
Copy link
Contributor

pohly commented Jul 30, 2024

Here's a proposal. @carlory: if this looks good, copy it into the description to ensure that it remains visible?

  • Some tips for figuring out how to replace --focus/skip with --label-filter:
    • go test -v ./test/e2e -args -list-tests (same for e2e_node) shows all tests.
    • Note that not all tags in [] 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.
  • If a job has a "canary" version, update that version first and try it out.
  • When converting some real jobs:
    • Create a separate tracking issue with a link to the jobs' testgrid entry.
    • Convert the job, linking to that issue with Related-to: ... (not Fixes: ...!).
    • Verify that the job still works as intended, then close the issue.
  • After converting a pre-submit job successfully, do the same for the corresponding periodic job.
  • Some best practices:
    • Replace focus/skip completely with a single label-filter.
    • Include !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.
    • Exclude tests with special requirements with 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.
    • Ginkgo can run serial jobs together with parallel ones in a single invocation by running the serial jobs (and only those) sequentially, so it's not absolutely required to use !Serial when running ginkgo -p and there is no need for separate serial/parallel jobs.
    • Beware that serial tests can affect the overall runtime. It might be useful to skip with !Slow and !Serial in pre-submits and only run the skipped tests in periodic jobs.

@aojea aojea added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/testing Categorizes an issue or PR as relevant to SIG Testing.
Projects
None yet
Development

No branches or pull requests

4 participants