Skip to content

Commit dd1fbf9

Browse files
committed
test(kamaji): fail when a nested subchart renders anything
A subchart under charts/kamaji/charts deploys unconditionally through this umbrella, so the suite asserts that no template there produces a document. It is the package's first helm-unittest suite, so the Makefile gains the test target the repository sweep discovers, and the suite directory is kept out of the packaged chart. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 47caa2a commit dd1fbf9

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎packages/system/kamaji/.helmignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/images
22
/hack
3+
/tests

‎packages/system/kamaji/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export NAMESPACE=cozy-$(NAME)
44
include ../../../hack/common-envs.mk
55
include ../../../hack/package.mk
66

7+
test:
8+
helm unittest .
9+
710
update:
811
rm -rf charts
912
tag=$$(git ls-remote --tags --sort="v:refname" https://github.com/clastix/kamaji | grep -E 'refs/tags/[0-9]+\.[0-9]+\.[0-9]+-edge$$' | awk -F/ 'END{print $$NF}') && \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
suite: no subchart is vendored under charts/kamaji
2+
3+
# The kamaji-etcd dependency's condition is never evaluated through this
4+
# umbrella chart, so any chart placed under charts/kamaji/charts deploys.
5+
templates:
6+
- "charts/kamaji/charts/*/templates/*"
7+
8+
tests:
9+
- it: renders nothing from a nested subchart
10+
asserts:
11+
- hasDocuments:
12+
count: 0

0 commit comments

Comments
 (0)