1
- # End-to-End Testing the Operator SDK
2
- The operator-sdk is automatically tested using both unit tests and end-to-end tests anytime
3
- a pull request is made. The end-to-end tests ensure that the operator-sdk acts as intended by
1
+ # E2E Testing the Operator SDK
2
+ The operator-sdk is automatically tested using both unit tests and e2e tests anytime
3
+ a pull request is made. The e2e tests ensure that the operator-sdk acts as intended by
4
4
simulating how a typical user might use the SDK. The automated tests test each PR and run in
5
- Travis CI, and Travis CI has a couple of features to simplify the end-to-end tests that we run.
6
- However, it is possible to run the end-to-end tests locally as well.
5
+ Travis CI, and Travis CI has a couple of features to simplify the e2e tests that we run.
6
+ However, it is possible to run the e2e tests locally as well.
7
7
8
8
## Running the E2E Tests Locally
9
9
To run the tests locally, the tests either need access to a remote kubernetes cluster or a
@@ -21,9 +21,10 @@ This will run the tests on the cluster specified by the provided kubeconfig and
21
21
memcached-operator image that is built will be pushed to ` <repository>:<tag> ` .
22
22
23
23
### Local Minikube Instance
24
- To run the end-to-end tests on a local minikube cluster, the minikube instance must be
25
- started and its local docker repo must be linked to the host's docker repo. To do this,
26
- run these commands:
24
+ To run the e2e tests on a local minikube cluster, the minikube instance must be
25
+ started and the host's docker client must be linked to the minikube instance's docker daemon,
26
+ which allows the host to add images to the minikube's local image registry directly.
27
+ To do this, run these commands:
27
28
```
28
29
$ minikube start --kubernetes-version v1.10.0
29
30
$ eval $(minikube docker-env)
@@ -35,11 +36,11 @@ $ go test ./test/e2e/...
35
36
```
36
37
37
38
The test will run using the kube config in $HOME/.kube/config (which is where the minikube
38
- kubeconfig is placed by default) and the operator image will be built to directly to the
39
- minikube instance's local docker repo .
39
+ kubeconfig is placed by default) and the operator image will be built and stored on the
40
+ minikube instance's local image registry .
40
41
41
42
## Cleanup of the E2E Tests
42
- The end-to-end tests create a new project using the operator-sdk to run in the provided
43
+ The e2e tests create a new project using the operator-sdk to run in the provided
43
44
cluster. The tests are designed to cleanup everything that gets created, but some errors
44
45
can cause these cleanups to fail. For example, if a segfault occurs or a user kills the
45
46
testing process, the cleanup functions will not run. To manually clean up a test:
0 commit comments