Skip to content

Commit 9ee84b4

Browse files
authored
docs: add test command documentation (#404)
* docs: add test command documentation * doc/sdk-cli-reference.md: improve description of -t
1 parent 9178924 commit 9ee84b4

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

doc/sdk-cli-reference.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,33 @@ Create app-operator/.gitignore
156156
...
157157
```
158158

159+
## test
160+
161+
### Flags
162+
163+
* `-t, --test-location` **(required)** string - location of e2e test files
164+
* `-k, --kubeconfig` string - location of kubeconfig for kubernetes cluster
165+
* `-c, --crd` string - location of CRD manifest yaml file
166+
* `-r, --rbac` string - location of RBAC manifest yaml file
167+
* `-o, --operator` string - location of Operator manifest yaml file
168+
* `-g, --go-test-flags` string - extra arguments to pass to `go test` (e.g. -g "-v -parallel=2")
169+
* `-h, --help` - help for test
170+
171+
### Use
172+
173+
The operator-sdk test command runs go tests built using the Operator SDK's test framework.
174+
175+
### Example:
176+
177+
#### Test
178+
179+
```bash
180+
operator-sdk test --test-location ./test/e2e/
181+
182+
# Output:
183+
ok github.com/operator-framework/operator-sdk-samples/memcached-operator/test/e2e 20.410s
184+
```
185+
159186
## up
160187

161188
### Available Commands

doc/testing/travis-build.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
Travis is set to run once every 24hrs against the master branch. The results of the builds can be found [here](https://travis-ci.org/operator-framework/operator-sdk/builds).
44

55
## Tool Versions
6-
* Kubernetes: 1.9.0
6+
* Kubernetes: 1.10.0
77
* Minikube: 0.25.2
88
* Go: 1.10.1
99

1010
## Test Workflow
11-
1. Run unit tests
12-
2. Ensure proper formatting
13-
3. Install the sdk
14-
4. Create memcached operator from [user-guide.md](https://github.com/operator-framework/operator-sdk/blob/master/doc/user-guide.md#build-and-run-the-operator)
15-
5. Fill out handler.go and types.go
16-
6. Generate and build the operator for k8s
17-
7. Run the deployment
11+
1. Build the operator-sdk binary
12+
2. Run unit tests
13+
3. Run end-to-end tests
14+
- Memcached: Creates the example memcached-operator project using the operator-sdk
15+
- Cluster: Runs the example memcached-operator in the cluster and spins up 3 memcached containers in a deployment and verifies that all 3 are available.
16+
It then scales the deployment to 4 containers and verifies that there are 4 available containers in the deployment
17+
- Local: Same as cluster test, but runs the operator using `up local` instead of in a deployment in the cluster.
18+
4. Ensure proper formatting
19+
5. Ensure all go files contain a license header
20+
6. Ensure all error messages have consistent capitalization

0 commit comments

Comments
 (0)