/qa-iac:helm-chart-testerfrom qa-iac
Writes and runs unit tests for Helm chart templates using helm-unittest. Supports assertions like isKind, equal, matchRegex, and snapshot for validating rendered Kubernetes manifests.
Ships in qa-iac. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
helm-unittest (Helm plugin) unit-tests the rendered chart output - assert specific fields, conditional behaviors, value substitutions - to catch template bugs before deploying.
{{ if .Values.foo }}); tests
verify both branches.helm plugin install https://github.com/helm-unittest/helm-unittest
helm plugin list # verify
# charts/mychart/tests/deployment_test.yaml
suite: deployment template
templates:
- templates/deployment.yaml
tests:
- it: should set the right image
set:
image.repository: myapp
image.tag: v1.2.3
asserts:
- isKind:
of: Deployment
- equal:
path: spec.template.spec.containers[0].image
value: myapp:v1.2.3
- it: should add the configured env vars
set:
env:
- name: API_URL
value: https://api.example.com
- name: LOG_LEVEL
value: debug
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: API_URL
value: https://api.example.com
- it: should add resource limits when set
set:
resources:
limits:
memory: 512Mi
cpu: 500m
asserts:
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 512Mi
- it: should NOT add resource limits when unset
asserts:
- notExists:
path: spec.template.spec.containers[0].resources.limits
The set: block overrides values; asserts: checks the rendered
output.
| Assertion | Use |
|---|---|
equal | Exact value match |
notEqual | Inverse |
isKind | Document is the expected Kind |
isAPIVersion | Specific API version |
isNullOrEmpty | Field is null / empty |
notNullOrEmpty | Field has a value |
exists | Field exists |
notExists | Field absent |
contains | Array contains an item |
notContains | Inverse |
matchRegex | Field matches regex |
notMatchRegex | Inverse |
failedTemplate | Template should fail to render (negative test) |
# All tests for a chart
helm unittest charts/mychart/
# Specific test file
helm unittest charts/mychart/ -f tests/deployment_test.yaml
# Update snapshots (if using snapshot assertions)
helm unittest charts/mychart/ -u
For complex rendered manifests, snapshot the output:
tests:
- it: should render the full deployment correctly
asserts:
- matchSnapshot: {}
First run captures the snapshot; subsequent runs compare. A diff fails the test. Useful for catching unintended template changes.
Per golden-file-conventions (in the qa-test-data plugin):
sanitize the snapshots (strip volatile fields like timestamps).
helm lint charts/mychart/
Catches:
name, version, appVersion).values.schema.json present).Run alongside unit tests in CI.
# See the rendered output without applying
helm template myrelease charts/mychart/ -f values.test.yaml
# Compare two renders (e.g., before / after a change)
helm template myrelease charts/mychart/ -f values.test.yaml > new.yaml
git stash
helm template myrelease charts/mychart/ -f values.test.yaml > old.yaml
git stash pop
diff old.yaml new.yaml
Useful for review: "what does this change actually produce?"
jobs:
helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: azure/setup-helm@v4
with: { version: 'v3.16.4' }
- run: helm plugin install https://github.com/helm-unittest/helm-unittest
- run: helm lint charts/mychart/
- run: helm unittest charts/mychart/
For deeper verification, render charts and run them through OPA / Conftest:
helm template myrelease charts/mychart/ -f values.yaml | conftest test -
The Conftest step catches policy violations the unit tests don't
cover (e.g., "all containers must have resource limits"). See
policy-as-code-runner.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
Skipping helm lint | Schema violations slip; install fails at deploy. | Always lint (Step 6). |
Snapshot-only tests (no equal checks) | Snapshots accept any change; explicit assertions catch intent. | Mix snapshots + explicit (Step 2 + Step 5). |
| One mega-test file per chart | Test file becomes unreadable; merge conflicts. | One test file per template. |
| Hardcoded image tags in tests | Tests pass against the wrong tag if values default. | Set image tag explicitly via set:. |
Skipping the negative tests (notExists, failedTemplate) | Unintended additions slip through. | Test absences too (Step 2 example). |
helm install --dry-run + admission webhooks.github.com/helm-unittest/helm-unittest.helm.sh/docs/.policy-as-code-runner -
policy-level testing of rendered manifests.golden-file-conventions - for snapshot sanitization patterns.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/checkov-policyUse for any question or task about Checkov or scanning infrastructure code (Terraform, CloudFormation, Kubernetes, Helm, ARM, Serverless, CDK) with the broadest built-in rule set, including custom security checks written in Python: SARIF and JUnit output, and a baseline so CI fails only on new findings. Single-tool option: trivy-config./policy-as-code-runnerUse when a team needs custom policies that off-the-shelf scanners don't cover (cost limits, required tags, security baselines) enforced in CI. Writes OPA Rego policies and runs Conftest against Kubernetes manifests, Terraform plans, Dockerfiles or any structured data; also covers Cedar./trivy-configUse for any question or task about scanning infrastructure code for misconfigurations with one tool, including Kubernetes manifests, Terraform, CloudFormation, Helm, ARM and Dockerfiles that run as root, or migrating off tfsec: trivy config with severity gating, .trivyignore suppressions, custom Rego checks and SARIF for GitHub code scanning. Legacy tfsec is in its references.2 plugins ship this exact skill · first indexed Nov 12, 2026
npx claudepluginhub testland/qa --plugin qa-iacOther plugins' skills for the same job