Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nasusoba committed Mar 14, 2024
1 parent 933c3f8 commit 6e0803a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
15 changes: 12 additions & 3 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ You could refer to the [Testing Cluster API](https://cluster-api.sigs.k8s.io/dev
make docker-build-e2e # should be run everytime you change the controller code
make test-e2e # run all e2e tests
```
### Run a specific e2e test
To run a specific e2e test, you can use the `GINKGO_FOCUS` environment variable to specify the test you want to run. For example:
```shell
make test-e2e GINKGO_FOCUS="Creating a cluster"
make GINKGO_FOCUS="Creating a cluster" test-e2e # only run the "Creating a cluster" e2e test
```
### Run the e2e test with tilt
It is quite useful to run the e2e test with [tilt](https://cluster-api.sigs.k8s.io/developer/tilt), so that you will not need to rebuild docker image with `make docker-build-e2e` everytime. Also you will not need to wait a new cluster creation and setup. If you set up your tilt cluster with name and current context points to this cluster, you could run:
```shell
# running e2e for the cluster pointed by the current context
make USE_EXISTING_CLUSTER=true test-e2e
```
Also it is quite useful to run the e2e test with [tilt](https://cluster-api.sigs.k8s.io/developer/tilt), so that you will not need to rebuild docker image with makefile everytime.
## Develop an e2e test
You could refer to [Developing E2E tests](https://cluster-api.sigs.k8s.io/developer/e2e) for a complete guide for developing e2e tests.
You could refer to [Developing E2E tests](https://cluster-api.sigs.k8s.io/developer/e2e) for a complete guide for developing e2e tests.

## Troubleshooting
* [Cluster API with Docker - "too many open files".](https://cluster-api.sigs.k8s.io/user/troubleshooting.html?highlight=too%20many#cluster-api-with-docker----too-many-open-files)
11 changes: 10 additions & 1 deletion test/e2e/config/k3s-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@ providers:
- name: docker
type: InfrastructureProvider
versions:
- name: v1.6.2
- name: v1.6.2 # used during e2e-test
value: https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.6.2/infrastructure-components-development.yaml
type: url
files:
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- name: v1.7.99 # next; use manifest from source files
# added to support tilt
value: https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/infrastructure-components-development.yaml
type: url
files:
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
files:
- sourcePath: "../data/infrastructure-docker/cluster-template.yaml"
- name: k3s
Expand Down

0 comments on commit 6e0803a

Please sign in to comment.