Skip to main content

A plugin to provide different types and configs of Kubernetes clusters that can be used for testing.

Project description

pytest-helm-charts

build codecov Documentation Status PyPI Version Python Versions Apache License

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
  • supports custom resource for the Giant Swarm App Platform:
  • provides set of fixtures to easily work with Helm charts

Requirements

  • python 3.8+
  • pytest 5.4.2+
  • pykube-ng = 20.7.0+

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 kube-app-testing 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 run poetry 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-helm-charts-0.7.0b2.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_helm_charts-0.7.0b2-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest-helm-charts-0.7.0b2.tar.gz.

File metadata

  • Download URL: pytest-helm-charts-0.7.0b2.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.12 Linux/5.11.0-1022-azure

File hashes

Hashes for pytest-helm-charts-0.7.0b2.tar.gz
Algorithm Hash digest
SHA256 19aada4e426b927f1a91ec0c811c079f2363cff21cf9f1674e6fda8a31dd84f8
MD5 3136f97229d421b3ab3f4e6824176018
BLAKE2b-256 2b141e43bf275dfe71a8e8c9c3081b314686f62ead9d224229753062e89a95d5

See more details on using hashes here.

File details

Details for the file pytest_helm_charts-0.7.0b2-py3-none-any.whl.

File metadata

  • Download URL: pytest_helm_charts-0.7.0b2-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.12 Linux/5.11.0-1022-azure

File hashes

Hashes for pytest_helm_charts-0.7.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7099df7b413416c216763b0fa904ec155b7ea07d9f7e2fe27e949ae6f1c3bea
MD5 343e988b3174c81adce929456a4b0446
BLAKE2b-256 120a6111855baedd98b2eeb0d54ad28ed3aa8c4258e9a29692b4d144ee585dbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page