kubernetes/test/e2e
Stephen Kitt 3f36c83c68
Switch to stretchr/testify / mockery for mocks
testify is used throughout the codebase; this switches mocks from
gomock to testify with the help of mockery for code generation.

Handlers and mocks in test/utils/oidc are moved to a new package:
mockery operates package by package, and requires packages to build
correctly; test/utils/oidc/testserver.go relies on the mocks and fails
to build when they are removed. Moving the interface and mocks to a
different package allows mockery to process that package without
having to build testserver.go.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-06-20 19:42:53 +02:00
..
apimachinery e2e/apimachinery/watchlist: when comparing streamed data do not call the API directly instead use the added data. 2024-06-14 13:56:05 +02:00
apps Refactor Job e2e test to make them possible for conformance promotion 2024-06-13 13:41:51 +02:00
architecture e2e: enhance SIGDescribe 2023-10-10 18:15:49 +02:00
auth ClusterTrustBundle projection: e2e test 2023-11-03 12:08:35 -07:00
autoscaling tag e2e test that depends on cloud-provider-gcp 2024-05-27 18:14:48 +00:00
chaosmonkey e2e: use Ginkgo context 2022-12-16 20:14:04 +01:00
cloud Merge pull request #123845 from HirazawaUi/promote-DisableNodeKubeProxyVersion-to-beta 2024-05-08 12:23:19 -07:00
common e2e: add TERM trap to pod sleep command 2024-06-11 13:52:47 +08:00
dra e2e_node: DRA: add CountCalls API 2024-06-07 22:47:23 +03:00
environment e2e labels: ensure that the lists remain sorted 2024-02-13 11:51:45 +01:00
feature Add Happy Path VolumeAttributesClass CSI E2E Tests 2024-06-10 20:03:54 +00:00
framework Merge pull request #125478 from aroradaman/handle-index-error 2024-06-16 12:46:29 -07:00
instrumentation Update PodSecurityLevel used during tests 2024-05-15 16:50:30 +02:00
kubectl Add logging to show which unexpected events were received in kubectl events e2e test 2024-05-23 20:33:17 -04:00
lifecycle e2e: use framework labels 2023-11-01 15:17:34 +01:00
network e2e/framework/metrics: handle index out of bounds panic 2024-06-15 00:42:11 +05:30
node e2e: add TERM trap to pod sleep command 2024-06-11 13:52:47 +08:00
nodefeature Merge pull request #123160 from bart0sh/PR133-e2e-node-device-plugin-fix-features 2024-05-24 09:23:10 -07:00
perftype hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
reporters e2e: comment the known limitation of the ProgressReporter 2022-12-23 18:43:49 +08:00
scheduling Remove gcp in-tree cloud provider and credential provider 2024-05-01 09:03:53 -04:00
storage Switch to stretchr/testify / mockery for mocks 2024-06-20 19:42:53 +02:00
testing-manifests Merge pull request #124842 from carlory/honor-pv-reclaim-policy-e2e 2024-06-19 13:26:41 -07:00
upgrades Remove gcp in-tree cloud provider and credential provider 2024-05-01 09:03:53 -04:00
windows Fix kubelet on Windows fails if a pod has SecurityContext with RunAsUser. 2024-05-23 12:44:51 +08:00
e2e-example-config.json
e2e.go Use new WaitForAlmostAllPodsReady function ins e2e setup 2024-04-17 23:18:26 -05:00
e2e_test.go chore:update invalid package name by golint 2024-05-04 22:55:43 +08:00
providers.go Remove gcp in-tree cloud provider and credential provider 2024-05-01 09:03:53 -04:00
README.md e2e: use framework labels 2023-11-01 15:17:34 +01:00
suites.go e2e: use error wrapping with %w 2023-02-06 15:39:13 +01:00

test/e2e

This is home to e2e tests used for presubmit, periodic, and postsubmit jobs.

Some of these jobs are merge-blocking, some are release-blocking.

e2e test ownership

All e2e tests must adhere to the following policies:

  • the test must be owned by one and only one SIG
  • the test must live in/underneath a sig-owned package matching pattern: test/e2e/[{subpath}/]{sig}/..., e.g.
    • test/e2e/auth - all tests owned by sig-auth
    • test/e2e/common/storage - all tests common to cluster-level and node-level e2e tests, owned by sig-node
    • test/e2e/upgrade/apps - all tests used in upgrade testing, owned by sig-apps
  • each sig-owned package should have an OWNERS file defining relevant approvers and labels for the owning sig, e.g.
# test/e2e/node/OWNERS
# See the OWNERS docs at https://go.k8s.io/owners

approvers:
- alice
- bob
- cynthia
emeritus_approvers:
- dave
reviewers:
- sig-node-reviewers
labels:
- sig/node
  • packages that use {subpath} should have an imports.go file importing sig-owned packages (for ginkgo's benefit), e.g.
// test/e2e/common/imports.go
package common

import (
	// ensure these packages are scanned by ginkgo for e2e tests
	_ "k8s.io/kubernetes/test/e2e/common/network"
	_ "k8s.io/kubernetes/test/e2e/common/node"
	_ "k8s.io/kubernetes/test/e2e/common/storage"
)
  • test ownership must be declared via a top-level SIGDescribe call defined in the sig-owned package, e.g.
// test/e2e/lifecycle/framework.go
package lifecycle

import "k8s.io/kubernetes/test/e2e/framework"

// SIGDescribe annotates the test with the SIG label.
var SIGDescribe = framework.SIGDescribe("cluster-lifecycle")
// test/e2e/lifecycle/bootstrap/bootstrap_signer.go

package bootstrap

import (
	"github.com/onsi/ginkgo"
	"k8s.io/kubernetes/test/e2e/lifecycle"
)
var _ = lifecycle.SIGDescribe("cluster", feature.BootstrapTokens, func() {
  /* ... */
  ginkgo.It("should sign the new added bootstrap tokens", func(ctx context.Context) {
    /* ... */
  })
  /* etc */
})

These polices are enforced:

  • via the merge-blocking presubmit job pull-kubernetes-verify
  • which ends up running hack/verify-e2e-test-ownership.sh
  • which can also be run via make verify WHAT=e2e-test-ownership

more info

See kubernetes/community/.../e2e-tests.md