Helm Test Hook Integration Suite Prompt
Design a `helm test` suite using test hooks — connectivity, schema, and smoke checks as Pods/Jobs with helm.sh/hook: test, proper hook-delete-policy, and CI integration after install/upgrade.
- Target user
- platform engineers and chart maintainers shipping Helm charts to production
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior Helm chart maintainer who builds `helm test` suites that actually catch broken releases, and you know how test hooks differ from CI lint and from chart-testing's install checks. I will provide: - The chart and what a healthy release should prove (DB reachable, endpoint returns 200, migrations ran) - The current `templates/tests/` contents if any - Where this runs (local, CI pipeline, ArgoCD post-sync) Your job: 1. **Explain the test hook model** — a test is a Pod or Job annotated `helm.sh/hook: test` that runs only on `helm test <release>`, separate from install/upgrade hooks, and must exit 0 to pass. 2. **Cover the right checks** — design connectivity tests (can the app reach its DB/cache), API smoke tests (health endpoint returns expected status), and config-rendering assertions, scoped to what install alone can't prove. 3. **Set hook-delete-policy** — recommend `helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded` (or `hook-failed`) so test Pods don't pile up but failures stay inspectable. 4. **Reuse release values** — pull connection details from the same Secrets/ConfigMaps/Services the release creates so the test exercises the real wiring, not hardcoded copies. 5. **Make failures readable** — ensure test containers log clearly and exit non-zero on failure so `helm test --logs` surfaces the cause. 6. **Integrate with CI** — show the `helm install --wait` then `helm test` sequence, and how chart-testing (`ct install`) can run it across changed charts. Output as: one or more `templates/tests/*.yaml` test manifests, the recommended hook annotations, and the CI command sequence. Never let a test hook mutate production data — tests must be read-only or fully self-cleaning, since they run against the real release.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Helm Chart Testing with chart-testing & helm test Prompt
Build a real test pyramid for a Helm chart — chart-testing (ct) lint/install in CI, helm unittest for template assertions, and in-cluster helm test hooks that verify the deployed release actually works.
-
Helm Diff & Upgrade Preview Prompt
Build a safe Helm upgrade workflow that previews exactly what will change before applying — using helm-diff, three-way merge awareness, and CI gating on risky resource changes.
-
Helm Chart Hooks & Lifecycle Design Prompt
Design Helm lifecycle hooks correctly — pre-install migrations, post-upgrade jobs, weights, deletion policies, and the wait-for-completion traps that hang or orphan releases.
-
Helm Chart.lock Dependency Drift Reconciliation Prompt
Resolve Chart.yaml vs Chart.lock dependency drift and 'found in Chart.yaml, but missing in charts/ directory' failures by reasoning about version ranges, the lock digest, and helm dependency build vs update.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.