Helm Unittest Test Suite
A Helm Unittest Test Suite file
| Type | object |
|---|---|
| File match |
**/charts/*/tests/*.yaml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/helm-unittest-test-suite/latest.json |
| Source | https://raw.githubusercontent.com/helm-unittest/helm-unittest/refs/heads/main/schema/helm-testsuite.json |
Validate with Lintel
npx @lintel/lintel check
A helm test suite is a collection of tests with the same purpose and scope defined in one single file.
Properties
tests (array
Where you define your test jobs to run
suite (string) optional
The suite name to show on test result output.
snapshotId (string) optional
A suffix to your snapshot file for the tests. Ideal for helm tests.
values (array
.The test values to apply for rendering of this chart.
set (object) optional
Set the values directly in the suite file. The key is the value path with the format just like --set option of helm install, for example image.pullPolicy.
The value is anything you want to set to the path specified by the key, which can be even an array or an object.
templates (array
The template files scope to test in this suite. The full chart will be rendered, however only the listed templates are filtered for validation.
Template files that are put in a templates sub-folder can be addressed with a linux path separator. Also the templates/ can be omitted.
Partial templates (which are prefixed with and _) are added automatically even if it is in a templates sub-folder, you don't need to add them again.
excludeTemplates (array
The template files which should be excluded from the scope of this test suite. Using wildcards it is possible to exclude multiple templates without listing them one-by-one.
release (object) optional
Define the {{ .Release }} object.
4 nested properties
name (string) optional
The release name, default to "RELEASE-NAME".
namespace (string) optional
The namespace which release be installed to, default to "NAMESPACE".
revision (integer) optional
The revision of current build, default to 0.
upgrade (boolean) optional
Whether the build is an upgrade, default to false.
capabilities (object) optional
Define the {{ .Capabilities }} object.
3 nested properties
majorVersion (integer) optional
The kubernetes major version, default to the major version which is set by helm.
minorVersion (integer) optional
The kubernetes minor version, default to the minor version which is set by helm.
apiVersions (array
A set of versions, default to the versionset used by the defined kubernetes version.
skip (object) optional
Using this flag, helm-unittest will automatically skip the 'suite' or 'test'.
2 nested properties
reason (string)
The reason to skip the suite or 'test'.
minimumVersion (string) optional
The minimum version of helm-unittest plugin required to run this test suite. If set, do not set reason, otherwise the test suite will be skipped regardless of the version.
postRenderer (object) optional
A helm post-renderer to apply after chart rendering but before validation.
2 nested properties
cmd (string)
The full path to the command to invoke, or just its name if it's on '$PATH'.
args (array
A list of command-line arguments to pass to the cmd.
chart (object) optional
Define the {{ .Chart }} object.
2 nested properties
version (string) optional
The semantic version of the chart, default to the version set in the Chart.
appVersion (string) optional
The app-version of the chart, default to the app-version set in the Chart.
kubernetesProvider: (object) optional
Define Kubernetes resources to fake.
2 nested properties
objects: (array of objects)
Define the Kubernetes objects to fake
scheme: (object)
Define the Kubernetes schema to fake
Definitions
values (array
.The test values to apply for rendering of this chart.
capabilities (object) optional
Define the {{ .Capabilities }} object.
majorVersion (integer) optional
The kubernetes major version, default to the major version which is set by helm.
minorVersion (integer) optional
The kubernetes minor version, default to the minor version which is set by helm.
apiVersions (array
A set of versions, default to the versionset used by the defined kubernetes version.
chart (object) optional
Define the {{ .Chart }} object.
version (string) optional
The semantic version of the chart, default to the version set in the Chart.
appVersion (string) optional
The app-version of the chart, default to the app-version set in the Chart.
documentIndex (integer) optional
The index of rendered documents (divided by ---) to be tested, default to -1, which results in asserting all documents (see Assertion).
Generally you can ignored this field if the template file render only one document.
documentSelector (object) optional
The path of the key to be match and the match value to assert.
Using this information, helm-unittest will automatically discover the documentIndex.
Generally you can ignored this field if the template file render only one document.
path (string)
The documentSelector path to find.
value (string|object) optional
When set, filter on value to match. When not set, filters on all documents where the path is found.
matchMany (boolean) optional
Set to *true to allow matching multiple documents. Defaults to false which means selector has to match single document across all templates.
skipEmptyTemplates (boolean) optional
Set to true to skip asserting templates which didn't render any matching documents. Defaults to *false which means selector have to find at least one document in every template.
skip (object) optional
Using this flag, helm-unittest will automatically skip the 'suite' or 'test'.
reason (string)
The reason to skip the suite or 'test'.
minimumVersion (string) optional
The minimum version of helm-unittest plugin required to run this test suite. If set, do not set reason, otherwise the test suite will be skipped regardless of the version.
postRenderer (object) optional
A helm post-renderer to apply after chart rendering but before validation.
cmd (string)
The full path to the command to invoke, or just its name if it's on '$PATH'.
args (array
A list of command-line arguments to pass to the cmd.
kubernetesProvider: (object) optional
Define Kubernetes resources to fake.
objects: (array of objects)
Define the Kubernetes objects to fake
scheme: (object)
Define the Kubernetes schema to fake
release (object) optional
Define the {{ .Release }} object.
name (string) optional
The release name, default to "RELEASE-NAME".
namespace (string) optional
The namespace which release be installed to, default to "NAMESPACE".
revision (integer) optional
The revision of current build, default to 0.
upgrade (boolean) optional
Whether the build is an upgrade, default to false.
templates (array
The template files scope to test in this suite. The full chart will be rendered, however only the listed templates are filtered for validation.
Template files that are put in a templates sub-folder can be addressed with a linux path separator. Also the templates/ can be omitted.
Partial templates (which are prefixed with and _) are added automatically even if it is in a templates sub-folder, you don't need to add them again.
excludeTemplates (array
The template files which should be excluded from the scope of this test suite. Using wildcards it is possible to exclude multiple templates without listing them one-by-one.
set (object) optional
Set the values directly in the suite file. The key is the value path with the format just like --set option of helm install, for example image.pullPolicy.
The value is anything you want to set to the path specified by the key, which can be even an array or an object.
templates (array
path (string) required
The set path to assert.
Map keys in path containing periods (.) are supported with the use of a jq-like syntax.