Skip to content

Commit

Permalink
Merge pull request #5149 from sbueringer/pr-doc-test-exec
Browse files Browse the repository at this point in the history
📖  add tips on how to speed up test execution
  • Loading branch information
k8s-ci-robot authored Aug 26, 2021
2 parents dbc0120 + 13c4d9e commit 31b6d2c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/book/src/developer/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,21 @@ a fake infrastructure provider to allow test coverage for testing the interactio

## Running unit and integration tests

Using the `test` target through `make` will run all of the unit and integration tests.
Run `make test` to execute all unit and integration tests.

<aside class="note">

<h1>Tips</h1>

When testing individual packages, you can speed up the test execution by running the tests with a local kind cluster.
This avoids spinning up a testenv with each test execution. It also makes it easier to debug, because it's straightforward
to access a kind cluster with kubectl during test execution. For further instructions, run: `./hack/setup-envtest-with-kind.sh`.

When running individual tests, it could happen that a testenv is started if this is required by the `suite_test.go` file.
However, if the tests you are running don't require testenv (i.e. they are only using fake client), you can skip the testenv
creation by setting the environment variable `CAPI_DISABLE_TEST_ENV` (to any non-empty value).

</aside>

## End-to-end tests

Expand Down

0 comments on commit 31b6d2c

Please sign in to comment.