Skip to content

Commit

Permalink
doc: add info env test
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Aug 2, 2020
1 parent 21f9343 commit 3d40d37
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/book/src/reference/envtest.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ err = testEnv.Stop()
Logs from the test runs are prefixed with `test-env`.

### Configuring your test control plane
You can use environment variables and/or flags to specify the `api-server` and `etcd` setup within your integration tests.

You can use environment variables and/or flags to specify the `kubectl`, `api-server` and `etcd` setup within your
integration tests. The location of the binaries which will be used by the [EnvtTest][envtest] is done due the following environment
variables. See:

```shell
$ export TEST_ASSET_KUBECTL=<kubectl-bin-path>
$ export TEST_ASSET_KUBE_APISERVER=<api-server-bin-path>
$ export TEST_ASSET_ETCD=<etcd-bin-path>
```

Note that `kubebuilder` scaffold in your Makefile the `setupenvtest` target which download the binaries and setup it.

#### Environment Variables

| Variable name | Type | When to use |
Expand Down Expand Up @@ -71,3 +82,4 @@ expectedOwnerReference := v1.OwnerReference{
}
Expect(deployment.ObjectMeta.OwnerReferences).To(ContainElement(expectedOwnerReference))
```
[envtest]: https://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest

0 comments on commit 3d40d37

Please sign in to comment.