Skip to content

Commit 78559e9

Browse files
author
Eric Stroczynski
authored
docs: link to kubebuilder's envtest setup instructions (#4861)
Signed-off-by: Eric Stroczynski <[email protected]>
1 parent c411820 commit 78559e9

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

website/content/en/docs/building-operators/golang/references/envtest-setup.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

website/content/en/docs/building-operators/golang/testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ The Operator SDK project recommends using controller-runtime's [envtest][envtest
1212
## Using EnvTest
1313

1414
You will see that `controllers/suite_test.go` is created when a controller is scaffolded by the tool. This file contains boilerplate for executing integration tests using [envtest][envtest] with [ginkgo](https://onsi.github.io/ginkgo/) and [gomega][gomega].
15+
Setup instructions, including those for disconnected environments, are found [here][envtest-setup].
1516

16-
17-
It means that you will implement your controller's tests in go using this stack and it will be called by the `suite_test.go` via go tool such as:
17+
These tests are runnable as native Go tests:
1818

1919
```shell
2020
go test controllers/ -v -ginkgo.v
@@ -31,10 +31,10 @@ Also you can write tests for your operator in a declarative using the [kuttl][ku
3131
To implement application-specific tests, the SDK's test harness, [scorecard][scorecard], provides the ability to ship custom code in container images as well, which can be referenced in the test suite. Because this test suite definition metadata travels with the Operator Bundle, it allows for functional testing of the Operator without the source code or the project layout being available. See [Writing Custom Scorecard Tests][writing-custom-scorecard-tests].
3232

3333
[envtest]: https://godoc.org/sigs.k8s.io/controller-runtime/pkg/envtest
34+
[envtest-setup]:https://book.kubebuilder.io/reference/envtest.html
3435
[writing-controller-tests]: https://book.kubebuilder.io/cronjob-tutorial/writing-tests.html
35-
[envtest-setup]: /docs/building-operators/golang/references/envtest-setup
3636
[writing-kuttl-scorecard-tests]: /docs/advanced-topics/scorecard/kuttl-tests
3737
[writing-custom-scorecard-tests]: /docs/advanced-topics/scorecard/custom-tests
3838
[scorecard]: /docs/advanced-topics/scorecard/scorecard
3939
[gomega]: https://onsi.github.io/gomega/
40-
[kuttl]: https://kuttl.dev/
40+
[kuttl]: https://kuttl.dev/

website/content/en/docs/contribution-guidelines/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ All the tests are run through the [`Makefile`][makefile]. Run `make help` for a
5252
[olm]: https://olm.operatorframework.io/
5353
[minikube]: https://kubernetes.io/docs/setup/learning-environment/minikube/
5454
[kind]: https://kind.sigs.k8s.io/
55-
[envtest-setup]: /docs/building-operators/golang/references/envtest-setup
55+
[envtest-setup]:https://book.kubebuilder.io/reference/envtest.html
5656
[makefile]: https://github.com/operator-framework/operator-sdk/blob/master/Makefile
5757
[k8s-version-compat]:/docs/overview#kubernetes-version-compatibility

0 commit comments

Comments
 (0)