Summary
The current Helm chart tests use bash scripts with helm template + grep assertions (e.g., tests/helm-template-test.sh). This works but is fragile — grep-based assertions break easily with formatting changes and have no structured access to YAML fields.
Proposal
Migrate to helm-unittest, the de facto standard for Helm chart testing. Benefits:
- Declarative YAML tests — no bash scripting
- Structured assertions — JSON path access to rendered YAML, no fragile grep
- Snapshot testing — catch unexpected template changes automatically
- Better CI integration — JUnit XML output, easy to plug into any CI pipeline
Example
Current (bash):
OUT=$(helm template test "$CHART_DIR" --set "agents.kiro.discord.enabled=true" 2>&1)
if echo "$OUT" | grep -q "^\[discord\]"; then
pass "[discord] section rendered"
else
fail "[discord] section missing"
fi
Proposed (helm-unittest):
suite: adapter enablement
templates:
- templates/configmap.yaml
tests:
- it: renders [discord] when enabled
set:
agents.kiro.discord.enabled: true
asserts:
- contains:
path: data["config.toml"]
content: "[discord]"
Migration steps
helm plugin install https://github.com/helm-unittest/helm-unittest
- Convert existing
tests/helm-template-test.sh cases to YAML under tests/
- Convert
tests/helm-adapter-enablement-test.sh cases
- Update CI to run
helm unittest charts/openab
- Remove old bash scripts
Context
Summary
The current Helm chart tests use bash scripts with
helm template+grepassertions (e.g.,tests/helm-template-test.sh). This works but is fragile — grep-based assertions break easily with formatting changes and have no structured access to YAML fields.Proposal
Migrate to helm-unittest, the de facto standard for Helm chart testing. Benefits:
Example
Current (bash):
Proposed (helm-unittest):
Migration steps
helm plugin install https://github.com/helm-unittest/helm-unittesttests/helm-template-test.shcases to YAML undertests/tests/helm-adapter-enablement-test.shcaseshelm unittest charts/openabContext
charts/openab/tests/helm-template-test.sh,charts/openab/tests/helm-adapter-enablement-test.sh