Unit-test Helm charts with YAML assertions before deployment templates reach clusters with helm-unittest
Render a Helm chart locally and assert on the generated Kubernetes objects before a broken template makes it to a cluster.
Prerequisites
Helm, the helm-unittest plugin or container image, a Helm chart repository, and chart test files written in YAML.
Installation
Use the upstream install or setup path that matches your environment:
- docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest
- docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest:3.11.1-0.3.0
- docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest:3.11.1-0.3.0 .
- docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest:3.11.1-0.3.0 -o test-output.xml -t junit .
Requirements and caveats from upstream:
- Docker Usage
- * for Helm 4, installation using webhooks GPG verification is not supported, so --verify=false is required when installing from git repository.
Docker Usage
Basic usage or getting-started notes:
When not defining any versions, it will install the latest version of binary into helm plugin directory, otherwise it will install the specified version.
Extracted from upstream docs: https://raw.githubusercontent.com/helm-unittest/helm-unittest/HEAD/README.md