test: ignore golden template files with -update
Add a template values check in the `assertGoldenTemplateFile()` function to only update golden files if they aren't templates. A note is printed when an update to a template golden file is needed and `-update` flag can't update it. Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
@@ -103,6 +103,18 @@ files used in the test, pass `-update` flag to the test as:
|
||||
make e2e TEST_ARGS="-update"
|
||||
```
|
||||
|
||||
Since not all packages use golden files for testing, `-update` argument must be
|
||||
passed only for the packages that use golden files. Use the variables
|
||||
`TEST_PKG_PATH` for unit tests and `E2E_TEST_PKG_PATH` for e2e tests, to set the
|
||||
path of the target test package:
|
||||
|
||||
```bash
|
||||
# Unit test
|
||||
make test TEST_PKG_PATH="./cmd/flux" TEST_ARGS="-update"
|
||||
# e2e test
|
||||
make e2e E2E_TEST_PKG_PATH="./cmd/flux" TEST_ARGS="-update"
|
||||
```
|
||||
|
||||
Teardown the e2e environment with:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user