You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/reference/envtest.md
+27-27Lines changed: 27 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,36 @@
1
1
# Configuring envtest for integration tests
2
2
3
-
The [`controller-runtime/pkg/envtest`][envtest] Go library helps write integration tests for your controllers by setting up and starting an instance of etcd and the
3
+
The [`controller-runtime/pkg/envtest`][envtest] Go library helps write integration tests for your controllers by setting up and starting an instance of etcd and the
4
4
Kubernetes API server, without kubelet, controller-manager or other components.
5
5
6
6
## Installation
7
7
8
8
Installing the binaries is as a simple as running `make envtest`. `envtest` will download the Kubernetes API server binaries to the `bin/` folder in your project
9
-
by default. `make test` is the one-stop shop for downloading the binaries, setting up the test environment, and running the tests.
9
+
by default. `make test` is the one-stop shop for downloading the binaries, setting up the test environment, and running the tests.
10
10
11
-
The make targets require `bash` to run.
11
+
The make targets require `bash` to run.
12
12
13
13
## Installation in Air Gapped/disconnected environments
14
-
If you would like to download the tarball containing the binaries, to use in a disconnected environment you can use
15
-
[`setup-envtest`][setup-envtest] to download the required binaries locally. There are a lot of ways to configure `setup-envtest` to avoid talking to
16
-
the internet you can read about them [here](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest#what-if-i-dont-want-to-talk-to-the-internet).
17
-
The examples below will show how to install the Kubernetes API binaries using mostly defaults set by `setup-envtest`.
14
+
If you would like to download the tarball containing the binaries, to use in a disconnected environment you can use
15
+
[`setup-envtest`][setup-envtest] to download the required binaries locally. There are a lot of ways to configure `setup-envtest` to avoid talking to
16
+
the internet you can read about them [here](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest#what-if-i-dont-want-to-talk-to-the-internet).
17
+
The examples below will show how to install the Kubernetes API binaries using mostly defaults set by `setup-envtest`.
18
18
19
19
### Download the binaries
20
-
`make envtest` will download the `setup-envtest` binary to `./bin/`.
20
+
`make envtest` will download the `setup-envtest` binary to `./bin/`.
21
21
```shell
22
22
make envtest
23
23
```
24
24
25
-
Installing the binaries using `setup-envtest` stores the binary in OS specific locations, you can read more about them
25
+
Installing the binaries using `setup-envtest` stores the binary in OS specific locations, you can read more about them
@@ -213,25 +213,25 @@ For further information see the issue raised in the controller-runtime [controll
213
213
214
214
Projects scaffolded with Kubebuilder can enable the [`metrics`][metrics] and the [`cert-manager`][cert-manager] options. Note that when we are using the ENV TEST we are looking to test the controllers and their reconciliation. It is considered an integrated test because the ENV TEST API will do the test against a cluster and because of this the binaries are downloaded and used to configure its pre-requirements, however, its purpose is mainly to `unit`test the controllers.
215
215
216
-
Therefore, to test a reconciliation in common cases you do not need to care about these options. However, if you would like to do tests with the Prometheus and the Cert-manager installed you can add the required steps to install them before running the tests.
216
+
Therefore, to test a reconciliation in common cases you do not need to care about these options. However, if you would like to do tests with the Prometheus and the Cert-manager installed you can add the required steps to install them before running the tests.
217
217
Following an example.
218
218
219
219
```go
220
-
// Add the operations to install the Prometheus operator and the cert-manager
221
-
// before the tests.
220
+
// Add the operations to install the Prometheus operator and the cert-manager
0 commit comments