* upgrade to latest dependencies bumping knative.dev/eventing ff4bc40...5f69768: > 5f69768 upgrade to latest dependencies (# 5817) > a6a819d upgrade to latest dependencies (# 5812) bumping knative.dev/networking c2191da...91e7d04: > 91e7d04 upgrade to latest dependencies (# 531) > 16ef524 upgrade to latest dependencies (# 529) > cc26c45 Update actions (# 530) > 0c6b765 Deprecate httpProtocol: "Disabled" in config-network (# 528) bumping knative.dev/pkg fa2f8f1...3463dd7: > 3463dd7 upgrade to latest dependencies (# 2315) > a5bb759 upgrade to latest dependencies (# 2314) > e61a20d Update actions (# 2313) > 0e24b49 Format go code (# 2312) bumping knative.dev/hack 815cd31...47ac3b0: > 47ac3b0 Split build tags that are in a comma separated list (# 83) > 8687668 [# 50] Add error message when Bash < 4 (# 79) > 8d79600 Fixes # 81 (# 82) > 51582ce fix misspelling functionallity -> functionality (# 78) > 675e1fd Correctly specify the user when creating clusterrolebinding for kind (# 80) bumping knative.dev/serving 7c6d4bc...30087cd: > 30087cd upgrade to latest dependencies (# 12145) > e5d8560 Format go code (# 12139) > c9b2e25 upgrade to latest dependencies (# 12141) > ebdd09e Update actions (# 12140) > caced61 Update net-certmanager nightly (# 12138) > c6f1707 Add logic to retry pause/resume for pod freezer (# 12049) > 0780c10 Trust k8s readiness signal (# 12086) > 0592224 Update net-kourier nightly (# 12135) > 1cac17a Fix HTTP Redirect test for Contour (# 12124) > 8ecc7f9 Update net-istio nightly (# 12134) > f37a630 Update net-certmanager nightly (# 12133) > 04efc1e Update net-kourier nightly (# 12128) > 8cc9b0d upgrade to latest dependencies (# 12132) * Update actions |
||
|---|---|---|
| .. | ||
| e2e | ||
| resources/tekton | ||
| test_images | ||
| README.md | ||
| common.sh | ||
| e2e-tests.sh | ||
| local-e2e-tests.sh | ||
| presubmit-integration-tests-latest-release.sh | ||
| presubmit-tests.sh | ||
| tekton-tests.sh | ||
| upload-test-images.sh | ||
README.md
Test
This directory contains e2e tests and testing docs:
- Unit tests are in the code base alongside the code they test
- e2e tests are in
test/e2e/
Running unit tests
To run all unit tests locally:
$ hack/build.sh -t
By default go test will not run the e2e tests,
which need -tags=e2e to be enabled.
Running E2E tests
To run the e2e tests locally, you need to have:
- Running knative environment.
knbinary in the $PATH.- Please Make sure that you are able to connect to the cluster by following the guide here
Before running the e2e tests please make sure you dont have any namespaces with
the name starting with kne2etests
Run all e2e tests:
$ test/local-e2e-tests.sh
Running E2E tests selectively
To run only serving specific e2e tests locally, use
E2E_TAGS="serving" test/local-e2e-tests.sh
To run only eventing specific e2e tests locally, use
E2E_TAGS="eventing" test/local-e2e-tests.sh
Running a single test case
To run one e2e test case, e.g. TestBasicWorkflow
test/local-e2e-tests.sh -run ^TestBasicWorkflow$
Running tests in short mode
Running tests in short mode excludes some large-scale E2E tests and saves
time/resources required for running the test suite. To run the tests in short
mode, use
the -short flag with go test
test/local-e2e-tests.sh -short
Running E2E tests as a project admin
It is possible to run the E2E tests by a user with reduced privileges, e.g. project admin. Some tests require cluster-admin privileges and those tests are excluded from execution in this case. Running the E2E tests then consists of these steps:
- The cluster admin creates test namespaces. Each test requires a separate namespace.
By default, the namespace names consist of
kne2etestsprefix and numeric suffix starting from 0:kne2etests0,kne2etests1, etc. The prefix can be configured using the KN_E2E_NAMESPACE env variable. The namespace can be created as follows:
Note: There are currently slightly over 30 tests but the number will grow so the number of created namespaces need to be adjusted.for i in $(seq 0 40); do kubectl create ns "${KN_E2E_NAMESPACE}${i}"; done - The project admin runs the test suite with specific flags:
It is expected that the current user is a project admin for all test namespaces and their KUBECONFIG is located atE2E_TAGS="project_admin" test/local-e2e-tests.sh --reusenamespace$HOME/.kube/configor the env variable$KUBECONFIGpoints to it.
E2E tests prow jobs
Two e2e tests prow jobs are run in CI:
- pull-knative-client-integration-tests: Runs client e2e tests with the nightly build of serving and eventing.
- pull-knative-client-integration-tests-latest-release: Runs client e2e tests with the latest release of serving and eventing. The latest release version can be configured here.
Test images
Building the test images
The upload-test-images.sh script can be used to
build and push the test images used by the e2e tests. The script
expects your environment to be setup as described in
DEVELOPMENT.md.
To run the script for all end to end test images:
./test/upload-test-images.sh
A docker tag may be passed as an optional parameter. This can be useful on
Minikube in tandem with the --tag flag:
PLATFORM environment variable is optional. If it is specified, test images
will be built for specific hardware architecture, according to its value
(for instance,linux/arm64).
eval $(minikube docker-env)
./test/upload-test-images.sh any-old-tag
Adding new test images
New test images should be placed in ./test/test_images.