diff --git a/docs/src/developers/testing.md b/docs/src/developers/testing.md index d71eb34d3..24dc6307d 100644 --- a/docs/src/developers/testing.md +++ b/docs/src/developers/testing.md @@ -4,10 +4,10 @@ - [Unit Tests](#unit-tests) - [Executing Tests](#executing-tests) - - [Creating tests](#creating-tests) + - [Creating Tests](#creating-tests) - [E2E Tests](#e2e-tests) - - [Running tests](#running-tests) - - [Adding tests](#adding-tests) + - [Running Tests](#running-tests) + - [Adding Tests](#adding-tests) @@ -17,7 +17,7 @@ In order to run the unit tests run the following command ```bash make test ``` -### Creating tests +### Creating Tests General unit tests of functions follow the same conventions for testing using Go's `testing` standard library, along with the [testify](https://github.com/stretchr/testify) toolkit for making assertions. Unit tests that require API clients use mock clients generated using [gomock](https://github.com/uber-go/mock). To simplify the usage of mock clients, this repo also uses an internal library defined in `mock/mocktest`. @@ -189,7 +189,7 @@ For e2e tests CAPL uses the [Chainsaw project](https://kyverno.github.io/chainsa spin up a cluster with the CAPL controllers installed and then uses `chainsaw-test.yaml` files to drive e2e testing. All test live in the e2e folder with a directory structure of `e2e/${COMPONENT}/${TEST_NAME}` -### Running tests +### Running Tests In order to run e2e tests run the following commands: ```bash # Required env vars to run e2e tests @@ -231,7 +231,7 @@ There are other selectors you can use to invoke specfic tests. Please look at th *Note: For any flavor e2e tests, please set the required env variables* -### Adding tests +### Adding Tests 1. Create a new directory under the controller you are testing with the naming scheme of `e2e/${COMPONENT}/${TEST_NAME}` 2. Create a minimal `chainsaw-test.yaml` file in the new test dir ```yaml