On this page
The short answerWhat goes stale in Helm docsExtract the examples firstFetch the dependenciesLint the chartRender the chart locallyValidate the rendered manifestsValidate the valuesUnit-test the templatesInstall and test in a throwaway clusterTest a whole repository of chartsTest the copies in your guidesKeep credentials out of the runRun it on every changeChecklist for a Helm example testWhere DocsAlive fitsWhat this does not replaceThe sources we checkedFAQHelm docs are full of commands and YAML: a repository to add, a chart to install, a values file to override, a few lines of output to compare against. A chart README tells the reader which values to set, and a quickstart tells them which commands to run in which order. Each of those can drift while the chart keeps working: a value is renamed, a dependency moves, a flag changes between Helm releases, a manifest uses a Kubernetes API that the cluster no longer serves, and the page a reader copies from now fails on the second command. This guide shows how to catch that before readers do: extract every documented example, lint the chart, render it locally and validate the result, unit-test the templates, and only then install it for real in a throwaway cluster.
The short answer
Test a Helm example in layers, because each layer catches a different failure, and the first layers need no cluster. Extract every command and YAML block from the docs into files a tool can read. Fetch the chart's dependencies with helm dependency build or helm dependency update. Run helm lint --strict over the chart with each documented values file. Render the chart locally with helm template, which needs no cluster, and validate the rendered manifests against Kubernetes schemas with a tool such as kubeconform. Unit-test the templates' logic with the helm-unittest plugin. Then, for the examples readers actually run, install the chart in a disposable cluster and run helm test against the release. The chart-testing tool, ct, bundles the lint and install steps for a repository of charts and runs them on the charts a pull request changed.
DocsAlive does not render charts or install them into your cluster. It reads the Markdown pages around the chart — the README, the quickstart, the tutorial, the upgrade guide — and runs the code blocks it can run in a fresh container, so the shell commands a reader copies are exercised in page order. Blocks that need a cluster or credentials are the ones a reader cannot run either without setup, and they are reported as such rather than as chart bugs. Keep the Helm tooling described here for the chart itself, and use an execution check for the prose pages readers follow. The installation docs guide covers the install steps that come before the first helm install, and the config examples guide covers YAML, JSON and TOML snippets in the same spirit.
What goes stale in Helm docs
Charts change in small steps, and each step can break a different part of the documentation:
- Values keys. A value is renamed, nested differently or removed. The documented override still reads naturally, but it either fails against a schema or silently does nothing, which is worse.
- Chart and dependency versions. The docs name a chart version, or a repository, that no longer matches what the chart declares. Readers install the version the page names and meet a behaviour the maintainers have since changed.
- Repository and registry addresses. The
helm repo addcommand in the quickstart points at an address that moved, or at a repository that has to be replaced by a different way to fetch the chart.
- Helm flags. The command line itself changes between Helm releases. A flag that was a switch becomes an option with values, a default changes, and a documented command behaves differently on the Helm version a new reader installed today.
- Kubernetes APIs. A rendered manifest uses an API version that newer clusters no longer serve. The chart renders cleanly on a laptop and fails on the reader's cluster.
- Sample output. The release notes, the status block or the test output printed in the docs no longer look like what Helm prints.
- Upgrade steps. A documented upgrade path assumes values that the new chart version has changed.
None of these need a reader to find them. Every one is visible to a linter, a renderer or a test run, which is the point of testing the examples instead of proofreading them.
Extract the examples first
Every tool below works on files, so the first job is getting each documented example into one, unchanged. Pull each command into a script that keeps the page it came from, and each values block into its own YAML file named for the page and the order in which it appears. A documented override such as a values snippet in the README is a values file in disguise: save it exactly as printed and feed it to the chart with the values option, so that the same file you test is the file the reader copies.
Do not tidy the examples as you extract them. If a documented values block has an indentation error or a key the chart does not define, that is the finding. Extraction that silently fixes the text produces a test suite that passes and docs that still fail for readers. Extract mechanically, check what you extracted, and fix the docs — not the test copies — when something fails. Extract the shell commands the same way, in page order, because a documented sequence only means something in sequence: the repository has to be added before the chart can be installed, and the release has to exist before it can be tested.
Fetch the dependencies
A chart that declares dependencies cannot be linted or rendered until the charts directory is populated. Two commands do that, and they behave differently on purpose. helm dependency update updates the on-disk dependencies to mirror the chart's metadata file: it verifies that the required charts are present and at an acceptable version, pulls the latest charts that satisfy the declared constraints, and writes a lock file. helm dependency build rebuilds the charts directory from that lock file without renegotiating versions, and mirrors the behaviour of update only when no lock file exists. For a docs test, build is usually the right choice because it reproduces the exact versions the maintainers committed; run update on a schedule, so a new dependency release shows up as a nightly failure instead of a surprise.
helm dependency build ./mychart
Lint the chart
The first check is the linter. The helm lint command takes the path to a chart and runs a series of tests to verify that the chart is well formed. If the linter finds something that would make the chart fail installation, it emits an error. If it finds something that breaks with convention or recommendation, it emits a warning. In a docs test you want both to fail the job, and the --strict flag does exactly that: it fails on lint warnings. Add --with-subcharts to lint dependent charts as well, and --quiet to print only warnings and errors:
helm lint ./mychart --strict --with-subcharts -f docs-values-readme-1.yaml
Lint with each documented values file, not only with the chart's defaults, because a documented override is part of what the docs promise. The -f option accepts a values file, --set takes values on the command line, and --set-string, --set-json and --set-file cover the other ways a reader may supply them. The linter also accepts --kube-version, a Kubernetes version used for capabilities and deprecation checks, which lets you ask whether the chart still lints cleanly against the oldest and newest cluster versions it claims to support.
The metadata file also deserves a glance. The chart's Chart.yaml requires an API version, a name and a version, and may declare a kubeVersion range of compatible Kubernetes versions. If the docs say the chart supports a range of clusters, that range is the first thing to check against the declared one.
Render the chart locally
Linting reads the chart. Rendering runs its templates. The helm template command renders chart templates locally and displays the output, and because it needs no cluster it is the workhorse of a documentation test. Two limits are worth knowing. Any value that would normally be looked up in the cluster is faked locally, and none of the server-side testing of chart validity — for example whether an API is supported — is done. Render is therefore a check that the templates produce YAML for the given values; it is not proof that a cluster accepts that YAML.
helm template my-release ./mychart -f docs-values-readme-1.yaml
Several options let you shape the render to the example under test. --kube-version sets the Kubernetes version reported to the templates as Capabilities.KubeVersion, and --api-versions (-a) sets the API versions reported as Capabilities.APIVersions, so a chart that renders different manifests depending on what the cluster supports can be rendered for each case. --show-only (-s) prints only the manifests rendered from the templates you name, which keeps a failure report short. --output-dir writes the executed templates to files in a directory instead of standard output, which is the form the next step wants. --include-crds adds the chart's custom resource definitions to the output, and --skip-tests leaves the chart's test manifests out of it.
A render failure in a documented example is a clear finding: the template references a value the documented overrides do not provide, or a function receives a type it cannot use, or a required value was added without the docs being told. Print the example's page and values file next to the error.
Validate the rendered manifests
Once the chart renders, check what it rendered. kubeconform is a Kubernetes manifest validator that checks files against schemas for a Kubernetes version you choose. Point it at the rendered output and ask for the Kubernetes version the docs claim to support. The -kubernetes-version option sets that version, -strict rejects properties that are not in the schema and duplicated keys, -summary prints a summary at the end, and -ignore-missing-schemas skips resources for which it has no schema instead of failing — useful for charts that ship custom resources, as long as you know what is being skipped:
helm template my-release ./mychart -f docs-values-readme-1.yaml --output-dir rendered
kubeconform -strict -summary -kubernetes-version 1.30.0 rendered
The Kubernetes version in that command is an example; use the oldest and newest versions your docs say the chart supports, and run the check once for each. This is the layer that catches a manifest using an API version a newer cluster no longer serves, before a reader's cluster rejects it. For machine-readable results kubeconform's -output option accepts json, junit, pretty, tap and text.
Validate the values
If a chart ships a values.schema.json file, Helm treats it as a JSON Schema imposing a structure on the chart's values file, and the lint, render and install commands check values against it unless you pass --skip-schema-validation. A schema is the strongest defence a chart has against a documented override with a wrong type or a misspelled key, because the failure arrives with a message instead of a silent no-op. If your chart has one, make sure none of your test commands skip it. If it does not, adding one is one of the cheaper ways to make the docs testable: a documented values block that does not validate is then a failure in every layer, not just a puzzle for the reader.
The command that shows a reader the available values is part of the docs too. helm show values inspects a chart — a directory, file or URL — and displays the contents of its values.yaml. If a quickstart tells readers to run it and edit the output, check that the output still contains the keys the page then tells them to change.
Unit-test the templates
Rendering shows what a template produces for one set of values. A unit test pins the behaviour: this value produces that field, this flag adds that resource. helm-unittest is a plugin that lets you write the tests in YAML, in files under the chart's tests directory with the suffix _test.yaml. Install it as a Helm plugin. The README gives different install lines for Helm 3 and Helm 4, so use the one that matches the Helm version in your test image, and add tests to the chart's .helmignore so the test files are not packaged:
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm unittest ./mychart
A suite names the templates under test and lists test cases, each with the values to set and the assertions to make. This is the example from the plugin's own README:
suite: test deployment
templates:
- deployment.yaml
tests:
- it: should work
set:
image.tag: latest
asserts:
- isKind:
of: Deployment
- matchRegex:
path: metadata.name
pattern: -my-chart$
- equal:
path: spec.template.spec.containers[0].image
value: nginx:latest
For documentation, write one case for each override the docs promise. If the README says that setting a value turns on a feature, a test sets that value and asserts the resource appears; if it says another value changes the image, a test asserts the image. When the chart changes and the README does not, one of those cases fails, and the failing case names the promise that broke. Unit tests need no cluster and run in seconds, so they belong in the pull request lane.
Install and test in a throwaway cluster
Some documented examples only mean something against a running cluster: the quickstart whose last step opens the service, the upgrade guide that moves a release from one chart version to the next. Run those in a disposable cluster, created for the job and destroyed afterwards. Before the real install, a dry run is a cheap middle step. The current Helm reference describes --dry-run on helm install as taking one of three values: none, which is the default and executes the operation normally; client, which simulates it client-side and avoids cluster connections; and server, which simulates it on the server and requires cluster connectivity. Combined with --debug it prints all generated manifests — including Secrets, which can contain sensitive values, so the --hide-secret flag exists to hide them. Check the flag's current form with helm install --help for the Helm version you run, because the way it takes its argument has differed between releases.
For the real run, install the chart exactly as the page says, with the page's own values, then run the chart's tests. A test in a Helm chart lives under the templates directory and is a workload definition, commonly a Pod or a Job, that specifies a container with a command to run. The container must exit successfully for the test to pass, and the definition must carry the hook annotation helm.sh/hook: test. The helm create command scaffolds an example, a pod that fetches the service with wget, in templates/tests/test-connection.yaml. You run the tests of a deployed release with helm test, giving it the name of the release:
helm install demo ./mychart --namespace default -f docs-values-quickstart.yaml
helm test demo --logs
Three details matter in a docs run. The documentation warns that if you test immediately after installing, the test may show a transient failure because the pods are not yet active, so wait for readiness before testing instead of retrying until it passes — the install command's wait option and the --timeout option, which sets how long Helm waits for any individual Kubernetes operation and defaults to five minutes, are the usual tools. --logs dumps the logs from the test pods after all tests complete, which is what turns a red result into something a maintainer can act on. And --filter selects tests by name, or excludes one with a leading exclamation mark, so a documented example can run only the test that corresponds to it.
A test that passes proves the chart installs and works with the values the page used. It does not prove the page's prose is right. To close that gap, make the test assert the thing the docs claim: if the quickstart says the service answers on a port, the test pod requests that port.
Test a whole repository of charts
When a repository holds many charts, run the checks with chart-testing. The ct tool is built for linting and testing pull requests: it detects the charts that changed against the target branch, and its flags let you choose all charts (--all), specific charts (--charts), and the directories to search (--chart-dirs). The ct lint command runs helm lint, a version-increment check, YAML schema validation of Chart.yaml, YAML linting of Chart.yaml and values.yaml, and maintainer validation. The ct install command runs helm install and helm test, and optionally helm upgrade with the upgrade flag, which checks that helm test passes for the upgrade path from the previous chart revision to the current one.
ct lint --chart-dirs charts --charts charts/mychart
ct install --chart-dirs charts --charts charts/mychart
The feature that matters most for documentation is custom values. A chart can have values files matching the pattern *-values.yaml in a directory named ci at the root of the chart, and both commands run once for each of them, falling back to the chart's defaults when none exist. Put the values from the docs' examples there: the quickstart's values as ci/quickstart-values.yaml, the high-availability example as ci/ha-values.yaml. The documented examples are then part of the chart's own CI, and a pull request that breaks one cannot merge. Settings can live in a ct.yaml file, which ct loads from the current directory, $HOME/.ct or /etc/ct when no config file is given. The --additional-commands option on ct lint runs extra commands per chart, such as a unit-test run, in the order you list them.
Test the copies in your guides
The chart README is not the only place a command or a values block lives. The quickstart shows the first install a new user runs. The tutorial builds a values file up over several pages. The upgrade guide shows the before and after of a renamed value. An article on the product's own site repeats the README, and a getting-started page in another repository repeats it again. Each copy was correct when it was pasted, and each one ages independently, so a chart change that the canonical example survives can still break the tutorial.
Extract and check the copies the same way as the canonical examples — the extraction step does not care which page a block came from. When a copy fails, fix the page, then search for the same block elsewhere. The documentation drift guide covers the general pattern: examples rarely live in one place, and testing only the canonical copy leaves the others to fail in front of readers. For the shell commands in a tutorial, the quickstart and tutorial testing guide describes running them in a clean environment, in page order.
Keep credentials out of the run
Helm docs routinely show passwords, tokens and image pull secrets in values files, and a test lane should be built so that none of them can be real. Three rules keep it safe. First, the lint, render, schema-validation and unit-test lanes need no cluster and no credentials, so run them in the plainest CI job you have, with no secrets in the environment. Second, the install lane uses a disposable cluster with credentials scoped to it, held in the CI secret store; never a kubeconfig copied from someone's laptop, and never one taken from the docs. Rendered output deserves a particular warning: a dry run prints generated manifests, including Secrets, so keep that output out of public logs or hide the Secrets. Third, scan the examples before you run them: if a documented values block ships with a real password, a token or a production hostname in it, that is a finding about the docs, and it should fail the run like any other error. The credentials in docs examples guide covers how to handle examples that genuinely need a key.
Run it on every change
- Pull requests: lint with
--strict, render, validate the manifests and run the unit tests on every change to the docs or the chart. These checks need no cluster, so there is no reason for them to be rarer than the lint you already run. The pre-commit guide shows how to run the same checks before a commit leaves a laptop.
- Releases: run the full set — including
ct installwith the upgrade check in a throwaway cluster, and a render against both the oldest and newest Kubernetes versions the docs name — before the new chart version is announced, so the docs and the chart change in the same step.
- Nightly: rebuild or update the dependencies and rerun lint, render and validation even when nobody touched the docs. Dependencies and Kubernetes versions change under docs that nobody edited, and the nightly run is what catches drift from the outside. The GitHub Actions guide covers wiring these jobs into a workflow.
Whichever cadence you choose, the failure has to reach a person. A failing docs test that only colours a dashboard red will be failing, unread, on the day a reader finds the same break by hand.
Checklist for a Helm example test
- Every command and values block extracted from the docs, unchanged, with its source page recorded.
- Dependencies fetched with
helm dependency buildand refreshed on a schedule withhelm dependency update.
helm lint --strictrun once per documented values file, with subcharts included.
helm templaterun for every documented example, for the oldest and newest supported Kubernetes versions.
- Rendered manifests validated against Kubernetes schemas, with any skipped resource kinds named.
- A
values.schema.jsonin the chart, with no test command skipping it.
- helm-unittest cases for every override the docs promise.
- Documented install commands run in a disposable cluster, followed by
helm testwith logs.
- Documented values committed as
ci/*-values.yamlso chart-testing runs them on pull requests.
- Copies in quickstarts, tutorials, upgrade guides and other repositories extracted and checked too.
- No real credentials in any example, and no cluster access in the lint and render lanes.
Where DocsAlive fits
The checks above cover the chart and its values. They do not cover the pages around it — the quickstart whose first command every new user runs, the tutorial that spans four pages, the README in each repository that repeats the install block. Those pages are Markdown, and their code blocks are where readers actually copy from. DocsAlive runs the code samples in your docs in a clean sandbox and reports what breaks: it installs DocsAlive as a GitHub App, runs the blocks, and opens fix PRs that a human approves. A free health check runs the samples on up to 40 pages of a public repo and sends a report within 2 business days — the quickest way to see where the copies in your guides stand. The docs testing checklist puts this execution layer next to the rest of the pre-release checks. If your infrastructure docs also cover Terraform, the Terraform docs testing guide applies the same layered approach.
What this does not replace
Documentation tests do not test the chart's design. A chart can lint clean, render, validate and pass its unit tests and still deploy an application that is misconfigured for production, because correctness of the design is not something these tools can see. Rendering is not installing: helm template fakes any value that would be looked up in the cluster and skips server-side validity checks, so it cannot tell you the cluster will accept the result. A passing helm test proves what the test asserts and nothing more. Security review, policy checks and load testing sit outside all of this. And none of it checks the prose — a guide can have perfectly valid examples and still explain them badly. What these checks remove is the specific, common failure where the docs show a command or a values block that the chart no longer accepts, and they remove it before a reader finds it.
The sources we checked
| Source | What it covers |
|---|---|
| Helm documentation: helm lint, helm template, helm install and helm test | The --strict, --with-subcharts, --kube-version, --skip-schema-validation, --api-versions, --show-only, --output-dir, --include-crds, --skip-tests, --dry-run, --hide-secret, --timeout, --logs and --filter options, the limits of local rendering, and what the commands print on lint errors and warnings |
| Helm documentation: chart tests, the chart file structure, helm dependency, helm repo add and helm show values | The test hook annotation and the exit-code rule for chart tests, the required Chart.yaml fields, the optional values.schema.json, the difference between dependency update and build, and the commands readers run first |
| chart-testing (ct) documentation | ct lint and ct install, what each runs, changed-chart detection, the ci directory and *-values.yaml pattern, ct.yaml, and the upgrade check |
| helm-unittest README | Installing the plugin, the suite file format and location, and the assertions used in the example |
| kubeconform README | The -kubernetes-version, -strict, -summary, -ignore-missing-schemas and -output options |
| DocsAlive product pages | What the health check runs, the GitHub App, and human-approved fix PRs |
FAQ
Is helm lint enough?
No. Lint checks the chart's structure and conventions. It does not tell you whether the templates render correctly for the values the docs document, whether the rendered manifests are valid for a given Kubernetes version, whether the chart behaves as the README says once installed, or whether the commands on the page still work. Rendering, schema validation, unit tests and an install with the chart's own tests answer those separate questions.
Does helm template check that my cluster will accept the chart?
No. The command renders templates locally and fakes values that would normally be looked up in the cluster; it does not perform server-side checks such as whether an API is supported. Validate the rendered manifests against schemas for the Kubernetes versions you support, and use a server-side dry run or a real install in a throwaway cluster for what only a cluster can tell you.
My chart README is generated. Do I still need this?
A generated README inherits the values the generator reads, but the quickstarts, tutorials and upgrade guides around it are written by hand and do not update themselves, and a generated table of values can still be stale if the generator is not rerun. Test the handwritten examples at minimum, and run the documented values through lint and render so a stale table shows up as a failure instead of a support ticket.




