Skip to content

Commit e113ccd

Browse files
committed
testing strategy: add policy for non-blocking jobs by path
This was motivated in part by kubernetes/test-infra#33463 (comment) and is part of an effort to document best practices.
1 parent ade28d6 commit e113ccd

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: contributors/devel/sig-testing/testing-strategy.md

+33
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,39 @@ The Kubernetes job uses [prow](https://prow.k8s.io) to implement the CI system.
2626
- **Postsubmit:** Runs after code is merged. Useful for building artifacts.
2727
- **Periodic:** Runs at scheduled intervals. Ideal for monitoring trends and catching regressions.
2828

29+
#### Non-blocking triggered by path
30+
31+
Usually, blocking pre-submit jobs run by default and non-blocking jobs don't. The `/test` command
32+
has to be used explicitly for such non-blocking jobs. It is possible to configure such
33+
jobs so that they [run automatically when certain paths are modified](https://github.com/kubernetes/test-infra/blob/ee70308f09c10f7cd933c26c98acc7ebf785d436/config/jobs/kubernetes/sig-node/sig-node-presubmit.yaml#L3201-L3202).
34+
35+
Use this with care! A non-blocking job that fails confuses other contributors
36+
who are not familiar with the job or the failures. If it runs too often, it
37+
wastes CI resources. The guidelines for setting up such a job are:
38+
39+
* The job owners are responsive and react to problems with the job.
40+
* The job must have a low failure rate to avoid confusion in drive-by PRs.
41+
* The importance of the feature must justify the extra CI resources (depends
42+
on how often it gets triggered).
43+
* The `run_if_changed` regular expression must be narrow enough that
44+
the job doesn't run for unrelated changes.
45+
46+
Note that such a job cannot detect all regressions. It's impossible to
47+
define all the things that might cause a need to run tests (e.g. tool changes,
48+
updates in packages that a feature depends on). Therefore it is required
49+
to have a periodic job which runs the same tests regularly.
50+
51+
The advantage of having a non-blocking job that gets triggered automatically is
52+
that reviewers don't need to remember to run it and that problems get
53+
discovered sooner. Without it, maintainers are forced to diagnose regressions
54+
in a periodic job and then have to ping the contributor who caused the problem.
55+
If that contributor is unresponsive, maintainers may have to fix the problem
56+
themselves.
57+
58+
Instead, the burden is on the contributor whose pull request fails the
59+
tests. If they are unresponsive, their change doesn't get merged and there's no
60+
regression.
61+
2962
#### SIG Release Blocking and Informing jobs
3063

3164
SIG Release maintains two sets of jobs that decide whether the release is

0 commit comments

Comments
 (0)