A plugin to provide different types and configs of Kubernetes clusters that can be used for testing.
A plugin to test helm charts on Kubernetes clusters.
Full documentation (including API) available on https://pytest-helm-charts.readthedocs.io/.
This plugin provides a set of pytest fixtures that allow you to easily write tests for Helm charts and run them on Kubernetes clusters.
It can be also used to test Helm charts deployed using the Open Source Giant Swarm App Platform.
Most important features:
- provides pykube-ng interface to access Kubernetes clusters
- provides environment variables based options to configure the target cluster to run on
- provides fixtures to work with some standard Kubernetes resources as well as some custom ones:
- provides set of fixtures to easily work with Helm charts
[tool.poetry.dependencies] list in the
You can install "pytest-helm-charts" via
pip install pytest-helm-charts
Running your tests
When you want to run your tests, you invoke
pytest as usual, just configuring
cluster and chart information using environment variables or command line options.
The following options are available as environment variables (start
to check corresponding command line options):
- "KUBECONFIG" - (mandatory) a path to kube config file used to connect to a k8s cluster
- "ATS_CHART_PATH" - path to a chart being tested (if a chart is tested)
- "ATS_CHART_VERSION" - version of the chart being tested (if a chart is tested)
- "ATS_CLUSTER_TYPE" - type of the cluster used for testing
- "ATS_CLUSTER_VERSION" - k8s version of the cluster used for testing
- "ATS_APP_CONFIG_FILE_PATH" - optional path to a
values.yamlfile used to configure a chart under test (if a chart is tested)
- "ATS_EXTRA_*" - any such arbitrary variable value will be extracted and included in the
Currently, the only supported cluster type is
external, which means the cluster is not
managed by the test suite. You just point the test suite to a
which can be used to connect to the Kubernetes API with
KUBECONFIG env variable
option. For creating development time clusters, we recommend using
If you use this project to test Helm charts against Giant Swarm App Platform, the
cluster must already have the platform components installed. Please refer to and use
app-test-suite tool to easily
KinD based clusters with all the components already installed.
The easiest way to get started is by checking our examples.
The list of available fixtures can be found by running
pytest --fixtures, but
you can also just check the most important fixtures.
Full API docs are also available.
Contributions are very welcome.
- Project is managed with
poetry, to start developing run
- Tests for all supported python versions can be run with
poetry run tox -- --log-cli-level info tests/
- Please ensure the coverage at least stays the same before you submit a pull request.
If you encounter any problems, please file an issue along with a detailed description.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for pytest_helm_charts-1.0.1-py3-none-any.whl