mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-22 15:41:47 +00:00
Improve the test suite docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
66780bbf54
commit
77c9611784
1 changed files with 22 additions and 7 deletions
|
|
@ -63,27 +63,42 @@ To get started with developing controllers, you might want to review
|
||||||
walks you through writing a short and concise controller that watches out
|
walks you through writing a short and concise controller that watches out
|
||||||
for source changes.
|
for source changes.
|
||||||
|
|
||||||
### How to run the test suite
|
## How to run the test suite
|
||||||
|
|
||||||
Prerequisites:
|
Prerequisites:
|
||||||
|
|
||||||
* go >= 1.16
|
* go >= 1.16
|
||||||
* kubectl >= 1.18
|
* kubectl >= 1.19
|
||||||
* kustomize >= 3.1
|
* kustomize >= 4.0
|
||||||
|
|
||||||
You can run the unit tests by simply doing
|
Install the [controller-runtime/envtest](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest) binaries with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make install-envtest
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you can run the unit tests with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make test
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
The e2e test suite uses [kind](https://kind.sigs.k8s.io/) for running kubernetes cluster inside docker containers. You can run the e2e tests by simply doing
|
After [installing Kubernetes kind](https://kind.sigs.k8s.io/docs/user/quick-start#installation) on your machine,
|
||||||
|
create a cluster for testing with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make setup-kind
|
make setup-kind
|
||||||
make e2e
|
```
|
||||||
|
|
||||||
# When done
|
Then you can run the end-to-end tests with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
Teardown the e2e environment with:
|
||||||
|
|
||||||
|
```bash
|
||||||
make cleanup-kind
|
make cleanup-kind
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue