...
1# test/e2e
2
3This is home to e2e tests used for presubmit, periodic, and postsubmit jobs.
4
5Some of these jobs are merge-blocking, some are release-blocking.
6
7## e2e test ownership
8
9All e2e tests must adhere to the following policies:
10- the test must be owned by one and only one SIG
11- the test must live in/underneath a sig-owned package matching pattern: `test/e2e/[{subpath}/]{sig}/...`, e.g.
12 - `test/e2e/auth` - all tests owned by sig-`auth`
13 - `test/e2e/common/storage` - all tests `common` to cluster-level and node-level e2e tests, owned by sig-`node`
14 - `test/e2e/upgrade/apps` - all tests used in `upgrade` testing, owned by sig-`apps`
15- each sig-owned package should have an OWNERS file defining relevant approvers and labels for the owning sig, e.g.
16```yaml
17# test/e2e/node/OWNERS
18# See the OWNERS docs at https://go.k8s.io/owners
19
20approvers:
21- alice
22- bob
23- cynthia
24emeritus_approvers:
25- dave
26reviewers:
27- sig-node-reviewers
28labels:
29- sig/node
30```
31- packages that use `{subpath}` should have an `imports.go` file importing sig-owned packages (for ginkgo's benefit), e.g.
32```golang
33// test/e2e/common/imports.go
34package common
35
36import (
37 // ensure these packages are scanned by ginkgo for e2e tests
38 _ "k8s.io/kubernetes/test/e2e/common/network"
39 _ "k8s.io/kubernetes/test/e2e/common/node"
40 _ "k8s.io/kubernetes/test/e2e/common/storage"
41)
42```
43- test ownership must be declared via a top-level SIGDescribe call defined in the sig-owned package, e.g.
44```golang
45// test/e2e/lifecycle/framework.go
46package lifecycle
47
48import "k8s.io/kubernetes/test/e2e/framework"
49
50// SIGDescribe annotates the test with the SIG label.
51var SIGDescribe = framework.SIGDescribe("cluster-lifecycle")
52```
53```golang
54// test/e2e/lifecycle/bootstrap/bootstrap_signer.go
55
56package bootstrap
57
58import (
59 "github.com/onsi/ginkgo"
60 "k8s.io/kubernetes/test/e2e/lifecycle"
61)
62var _ = lifecycle.SIGDescribe("cluster", feature.BootstrapTokens, func() {
63 /* ... */
64 ginkgo.It("should sign the new added bootstrap tokens", func(ctx context.Context) {
65 /* ... */
66 })
67 /* etc */
68})
69```
70
71These polices are enforced:
72- via the merge-blocking presubmit job `pull-kubernetes-verify`
73- which ends up running `hack/verify-e2e-test-ownership.sh`
74- which can also be run via `make verify WHAT=e2e-test-ownership`
75
76## more info
77
78See [kubernetes/community/.../e2e-tests.md](https://git.k8s.io/community/contributors/devel/sig-testing/e2e-tests.md)
View as plain text