The e2e test use the Cluster API test framework and use the CAPD as the infrastructure provider. Please make sure you have Docker and kind installed.
You could refer to the Testing Cluster API for more information.
The e2e image will be built with tag dev
. You should build the image first before running the test.
make docker-build-e2e # should be run everytime you change the controller code
make test-e2e # run all e2e tests
To run a specific e2e test, such as [PR-Blocking]
, use the GINKGO_FOCUS
environment variable as shown below:
make GINKGO_FOCUS="\\[PR-Blocking\\]" test-e2e # only run e2e test with `[PR-Blocking]` in its spec name
You could refer to Developing E2E tests for a complete guide for developing e2e tests.
A guide for developing a k3s e2e test:
- Group test specs by scenarios (e.g.,
create_test
,node_scale_test
,upgrade_test
). Create a new file undertest/e2e/
for new scenarios. - If a different docker cluster template is needed, create one under
test/e2e/infrastructure-docker/
and link it intest/e2e/config/k3s-docker.yaml
. - Define tunable variables in the cluster template as environment variables under
variables
intest/e2e/config/k3s-docker.yaml
. Enable necessary feature flags here as well (e.g.,EXP_CLUSTER_RESOURCE_SET: "true"
). - If reusing a cluster-api test spec, note that they assume the use of
KubeadmControlPlane
. For customization, copy code intotest/e2e/helpers.go
.
- Cluster API with Docker - "too many open files".
- invalid provider metadata
- If you see the error
invalid provider metadata: version v1.8.99 for the provider capd-system/infrastructure-docker does not match any release series
, it might be that the artifact you are using is outdated. Please remove the_artifacts
folder and try again.
- If you see the error