[#85] update testing documentation

This change updates testing documentation to take advantage of the
new make target included in [0]

[0]: https://review.opendev.org/#/c/711050/

Relates-To: #85

Change-Id: I25d7ee22f9cc5fcef38354a8eafb17c780240977
Signed-off-by: Alexander Hughes <Alexander.Hughes@pm.me>
This commit is contained in:
Alexander Hughes 2020-03-04 15:57:18 -05:00
parent abb28716c8
commit feb8e4e484

View File

@ -26,9 +26,6 @@ the following `make` targets:
```
# Runs all unit tests, then computes and reports the coverage
make cover
# Same as above, but in the same dockerized container as the CI gates
make docker-image-unit-tests
```
Good practice is to assert that the changed packages have not decreased in
@ -38,6 +35,31 @@ such as the following.
make cover PKG=./pkg/foo
```
Additional testing should be done to ensure that the proposed change meets an
expected level of quality. These tests include:
```
# Tidy, to ensure go.mod is up to date
make tidy
# Lint, to ensure code meets linting requirements
make lint
# Update-golden, to ensure the golden test data reflects the current test cases
make update-golden
```
When the above are done, if you would like to perform the same dockerized container
testing as the CI gates you can do so via:
```
make docker-image-test-suite
```
**NOTE**: If test cases are deleted you must first run make update-golden, and
commit your changes prior to running the ``docker-image-test-suite`` make target.
Otherwise the ``docker-image-test-suite`` make target (and the CI job) will fail.
## Test directory structure
Test files end in `_test.go`, and sit next to the tested file. For example,