The world model describes everything that is available for you to reason about in your test expectations. It contains,
among other things, the parsed rendering output, the message generated from NOTES.txt
, error messages (if any)
as well as the input values. The "world" is given as a JSON object, and is used as the input (.
at the beginning of
the pipeline) for every jq
filter that is evaluated as an expectation. To allow referencing properties of the world
model in custom functions, where .
might not have its original value, the world object can also be referenced via
the $_
variable.
This JSON object contains the following properties:
helm
: a JSON object representing the values passed to the Helm rendering engine, such asValues
,Release
,Chart
etc.notesRaw
: a string containing the message that would be displayed after runninghelm install
orhelm upgrade
, rendered from theNOTES.txt
template.notes
: same asnotesRaw
, but in normalized form - all sequences of one or more whitespaces (spaces, tabs, line breaks) having been replaced by a single space (' '
) character. This allows checking for the occurrence of phrases without paying attention to line wrapping, and is almost always to preferable overnotesRaw
.errorRaw
: a string containing the Helm-generated error message occurred from rendering templates (if any). Note that schema validation errors do not end up here.error
: same aserrorRaw
, but in normalized form (seenotes
above).objects
: an array of all the objects in the rendering output, parsed directly from YAML.
Additionally, for every object kind that occurred in the rendering output, the world object contains a field named after the plural form in lowercase. This field references a name-indexed object of all Kubernetes object of the given resource, provided the name is unique across all namespaces. That is, to locate the deployment "server", you can thus either write
.objects[] | select(.metadata.kind == "Deployment" and .metadata.name == "server")
or simply .deployments.server
. Note that since Helm releases should be confined to a single namespace, two or more
resources of the same kind and with the same name will be treated as an error.