Skip to content
Latchkey

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 120s

Common 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →