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: doc/sdk-cli-reference.md
+52-16Lines changed: 52 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,21 @@ Usage:
9
9
10
10
### Args
11
11
12
-
* image - is the container image to be built, e.g. "quay.io/example/operator:v0.0.1". This image will be automatically set in the deployment manifests.
12
+
* image - is the container image to be built, e.g. "quay.io/example/operator:v0.0.1".
13
13
14
14
### Flags
15
-
15
+
*`--enable-tests` bool - enable in-cluster testing by adding test binary to the image
16
+
*`--namespaced-manifest` string - path of namespaced resources manifest for tests (default "deploy/operator.yaml")
17
+
*`--test-location` string - location of tests (default "./test/e2e")
16
18
*`-h, --help` - help for build
17
19
20
+
18
21
### Use
19
22
20
-
The operator-sdk build command compiles the code, builds the executables,
21
-
and generates Kubernetes manifests. After build completes, the image would be built locally in docker. Then it needs to be pushed to remote registry.
23
+
The operator-sdk build command compiles the code and builds the executables. After build completes, the image is built locally in docker. Then it needs to be pushed to a remote registry.
24
+
25
+
If `--enable-tests` is set, the build command will also build the testing binary, add it to the docker image, and generate
26
+
a `deploy/test-pod.yaml` file that allows a user to run the tests as a pod on a cluster.
Copy file name to clipboardExpand all lines: doc/test-framework/writing-e2e-tests.md
+52-10Lines changed: 52 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -194,31 +194,73 @@ functions will automatically be run since they were deferred when the TestCtx wa
194
194
195
195
## Running the Tests
196
196
197
-
To make running the tests simpler, the `operator-sdk` CLI tool has a `test` subcommand that configures some
198
-
default test settings, such as locations of the manifest files for your global resource manifest file (by default `deploy/crd.yaml`) and your namespaced manifest file (by defualt `deploy/rbac.yaml` concatenated with `deploy/operator.yaml`), and allows the user to configure these runtime options. To use it, run the
199
-
`operator-sdk test` command in your project root and pass the location of the tests using the
200
-
`--test-location` flag. You can use `--help` to view the other configuration options and use
201
-
`--go-test-flags` to pass in arguments to `go test`. Here is an example command:
197
+
To make running the tests simpler, the `operator-sdk` CLI tool has a `test` subcommand that can configure
198
+
default test settings, such as locations of your global resource manifest file (by default
199
+
`deploy/crd.yaml`) and your namespaced resource manifest file (by default `deploy/sa.yaml` concatenated with
200
+
`deploy/rbac.yaml` and `deploy/operator.yaml`), and allows the user to configure runtime options. There are 2 ways to use the
201
+
subcommand: local and cluster.
202
+
### Local
203
+
To run the tests locally, run the `operator-sdk test local` command in your project root and pass the location of the tests
204
+
as an argument. You can use `--help` to view the other configuration options and use `--go-test-flags` to pass in arguments to `go test`. Here is an example command:
0 commit comments