2016-09-12 21:59:44 +03:00
|
|
|
# E2E Testing
|
|
|
|
|
|
|
|
End-to-end (e2e) testing is automated testing for real user scenarios.
|
|
|
|
|
|
|
|
## Build and run test
|
|
|
|
|
|
|
|
Prerequisites:
|
|
|
|
- a running k8s cluster and kube config. We will need to pass kube config as arguments.
|
|
|
|
- KUBERNETES_KUBECONFIG_PATH env var is required, e.g. `KUBERNETES_KUBECONFIG_PATH=$HOME/.kube/config`
|
|
|
|
|
|
|
|
As first step, we need to setup environment for testing:
|
|
|
|
```
|
2016-09-23 04:45:51 +03:00
|
|
|
$ ./hack/e2e setup
|
2016-09-12 21:59:44 +03:00
|
|
|
```
|
|
|
|
This will do all preparation work such as creating etcd controller.
|
|
|
|
|
|
|
|
e2e tests are written as go test. All go test techniques applies, e.g. picking what to run, timeout length.
|
|
|
|
Let's say I want to run all tests in "test/e2e/":
|
|
|
|
```
|
2016-09-23 04:45:51 +03:00
|
|
|
$ go test -v ./test/e2e/
|
2016-09-12 21:59:44 +03:00
|
|
|
```
|
|
|
|
|
2016-09-16 01:31:45 +03:00
|
|
|
Finally, we need to tear down the things we setup before:
|
|
|
|
```
|
2016-09-23 04:45:51 +03:00
|
|
|
$ ./hack/e2e teardown
|
2016-09-16 01:31:45 +03:00
|
|
|
```
|