File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 4242 - name : Run helm-unittest
4343 # by default looks for tests/*_test.yaml
4444 run : |
45- helm unittest --color --helm3 -f tests/unit/*_test.yaml .
45+ helm unittest --color --helm3 .
Original file line number Diff line number Diff line change 11# ` stackstorm-ha ` Helm chart Tests
22
3- This directory contains Helm chart integration and unit tests (under ` tests/integration/ ` and ` tests/unit/ ` respectively ).
3+ This directory contains Helm chart integration (under ` tests/integration/ ` ) and unit tests ( ` tests/unit-*_test.yaml ` ).
44
55## Unit tests
66
7- Unit tests (under ` tests/unit/ ` ) use [ ` helm-unittest ` ] ( https://github.com/quintush/helm-unittest ) .
7+ Unit tests (` tests/unit-*_test.yaml ` ) use [ ` helm-unittest ` ] ( https://github.com/quintush/helm-unittest ) .
88` helm-unittest ` uses a yaml-based test file to ensure that the templates generate expected features.
99For example, they can ensure that custom annotations are applied consistently to all of the deployments.
1010Unit tests do not require a running kubernetes cluster.
@@ -17,11 +17,16 @@ helm dependency update
1717
1818To run the tests manually from the chart's root dir:
1919```
20- helm unittest --helm3 tests/unit/*_test.yaml .
20+ helm unittest --helm3 .
2121```
2222
2323Note that ` helm-unittest ` still defaults to helm 2, so you must pass ` --helm3 ` or ` -3 ` for short.
24- You must also tell it where the unit tests are with ` -f ` because we keep unit tests in the ` tests/unit ` directory.
24+ ` helm-unittest ` does not have a configuraiton file which makes using non-standard directories (like ` tests/unit/ ` )
25+ very inconvenient (you would have to specify ` -f tests/unit/*_test.yaml ` on every invocation).
26+ So, we keep all of the unit test files under tests, but prefix them with ` unit- ` to separate them from
27+ the integration tests.
28+
29+ > Note! If you need to add unit tests, file names should follow this pattern: ` tests/unit-name_your_test.yaml `
2530
2631See https://github.com/quintush/helm-unittest/blob/master/DOCUMENT.md for details on writing unit tests.
2732
File renamed without changes.
You can’t perform that action at this time.
0 commit comments