A plugin to provide different types and configs of Kubernetes clusters that can be used for testing.
Project description
pytest-helm-charts
A plugin to test helm charts on Kubernetes clusters.
Full documentation (including API) available on https://pytest-helm-charts.readthedocs.io/.
Features
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 command line 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
Requirements
Please check [tool.poetry.dependencies]
list in the pyproject.toml
file.
Installation
You can install "pytest-helm-charts" via pip
from PyPI
:
pip install pytest-helm-charts
Usage
Running your tests
When you want to run your tests, you invoke pytest
as usual, just passing additional
flags on the command line. You can inspect them directly by running pytest -h
and
checking the "helm-charts" section.
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 kube.config
file,
which can be used to connect to the Kubernetes API with --kube-config
command line
option. For creating development time clusters, we recommend using
KinD.
If you use this project to test Helm charts against Giant Swarm App Platform, the existing
cluster must already have the platform components installed. Please refer to and use
the app-test-suite
tool to easily
create KinD
based clusters with all the components already installed.
Writing tests
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.
Contributing
Contributions are very welcome.
- Project is managed with
poetry
, to start developing runpoetry install
- Tests for all supported python versions can be run with
tox
:poetry run tox -- --log-cli-level info tests/
- Please ensure the coverage at least stays the same before you submit a pull request.
License
See LICENSE.
Changelog
See CHANGELOG.md.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_helm_charts-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 051c283b7b8df6423374866edcf609fe3cd61100df027e8470d7da84a8a87c9c |
|
MD5 | cdf303f1f61d8bc5edf0a44bc0949fd5 |
|
BLAKE2b-256 | 1e24e099f61487460f9e307ae744da78875963a1f3ff68d79bf7d197b01c64c2 |