From feb8e4e4846792fb866bb9ea8bae79fec2757ee8 Mon Sep 17 00:00:00 2001 From: Alexander Hughes Date: Wed, 4 Mar 2020 15:57:18 -0500 Subject: [PATCH] [#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 --- docs/source/testing-guidelines.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/source/testing-guidelines.md b/docs/source/testing-guidelines.md index 63068199d..b316ba79d 100644 --- a/docs/source/testing-guidelines.md +++ b/docs/source/testing-guidelines.md @@ -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,