helm test: Run Release Tests in CI
Run the test hooks defined in a chart against an installed release.
helm test executes pods annotated as helm.sh/hook: test in an installed release and reports pass/fail. In CI it is a post-deploy smoke gate: deploy with helm upgrade, then helm test to confirm the release actually works before promoting.
Common flags
RELEASE- the installed release to test (positional)-n NAMESPACE- release namespace--logs- stream the test pod logs--timeout=DURATION- fail if tests do not finish in time
Example in CI
Smoke-test a release and stream test logs.
shell
helm test api -n prod --logs --timeout 120sCommon errors in CI
- Error: ... test pod ... failed - the test container exited non-zero
- Error: ... timed out waiting for the condition - test pod never completed
- Error: release: not found - release not installed or wrong namespace
Key takeaways
- Runs a chart's test hooks as a post-deploy smoke gate.
- Use --logs to surface why a test pod failed in the job output.
- Requires test hooks defined in the chart; otherwise it does nothing.
Related guides
helm upgrade: Deploy Chart Changes in CIUpgrade a Helm release in CI with --install and --atomic: key flags, a deploy example, and the upgrade errors…
helm lint: Validate Charts in CILint a Helm chart in CI before deploying: values and strict flags, an example, and the lint errors that shoul…
helm rollback: Revert Releases in CIRoll a Helm release back to a previous revision in CI: revision and wait flags, an example, and the rollback…