k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/test/e2e/README.md (about)

     1  # test/e2e
     2  
     3  This is home to e2e tests used for presubmit, periodic, and postsubmit jobs.
     4  
     5  Some of these jobs are merge-blocking, some are release-blocking.
     6  
     7  ## e2e test ownership
     8  
     9  All 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  
    20  approvers:
    21  - alice
    22  - bob
    23  - cynthia
    24  emeritus_approvers:
    25  - dave
    26  reviewers:
    27  - sig-node-reviewers
    28  labels:
    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
    34  package common
    35  
    36  import (
    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
    46  package lifecycle
    47  
    48  import "k8s.io/kubernetes/test/e2e/framework"
    49  
    50  // SIGDescribe annotates the test with the SIG label.
    51  var SIGDescribe = framework.SIGDescribe("cluster-lifecycle")
    52  ```
    53  ```golang
    54  // test/e2e/lifecycle/bootstrap/bootstrap_signer.go
    55  
    56  package bootstrap
    57  
    58  import (
    59  	"github.com/onsi/ginkgo"
    60  	"k8s.io/kubernetes/test/e2e/lifecycle"
    61  )
    62  var _ = 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  
    71  These 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  
    78  See [kubernetes/community/.../e2e-tests.md](https://git.k8s.io/community/contributors/devel/sig-testing/e2e-tests.md)