pytest-helm-charts


Namepytest-helm-charts JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/giantswarm/pytest-helm-charts
SummaryA plugin to provide different types and configs of Kubernetes clusters that can be used for testing.
upload_time2024-02-07 07:14:29
maintainer
docs_urlNone
authorŁukasz Piątkowski
requires_python>=3.8.1,<4.0.0
licenseApache-2.0
keywords kubernetes helm chart
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-helm-charts

[![build](https://github.com/giantswarm/pytest-helm-charts/actions/workflows/main.yml/badge.svg)](https://github.com/giantswarm/pytest-helm-charts/actions/workflows/main.yml/badge.svg)
[![codecov](https://codecov.io/gh/giantswarm/pytest-helm-charts/branch/master/graph/badge.svg)](https://codecov.io/gh/giantswarm/pytest-helm-charts)
[![Documentation Status](https://readthedocs.org/projects/pytest-helm-charts/badge/?version=latest)](https://pytest-helm-charts.readthedocs.io/en/latest/?badge=latest)
[![PyPI Version](https://img.shields.io/pypi/v/pytest-helm-charts.svg)](https://pypi.org/project/pytest-helm-charts/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pytest-helm-charts.svg)](https://pypi.org/project/pytest-helm-charts/)
[![Apache License](https://img.shields.io/badge/license-apache-blue.svg)](https://pypi.org/project/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](https://docs.pytest.org/) 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](https://docs.giantswarm.io/basics/app-platform/).

Most important features:

- provides [pykube-ng](http://pykube.readthedocs.io/) interface to access Kubernetes clusters
- provides [environment variables based options](#usage) to configure the target cluster to run on
- provides fixtures to work with some standard Kubernetes resources as well as some custom ones:
  - [Kubernetes objects](pytest_helm_charts.k8s)
  - [Giant Swarm App Platform objects](pytest_helm_charts.giantswarm_app_platform)
  - [Flux CD objects](pytest_helm_charts.flux)
- provides set of fixtures to easily work with Helm charts

## Requirements

Please check `[tool.poetry.dependencies]` list in the [`pyproject.toml`](pyproject.toml) file.

## Installation

You can install "pytest-helm-charts" via `pip` from `PyPI`:

```bash
pip install pytest-helm-charts
```

## Usage

### 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 `pytest` with `-h`
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.yaml` file 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 `test_extra_info` fixture

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 `KUBECONFIG` env variable
option. For creating development time clusters, we recommend using
[KinD](https://kind.sigs.k8s.io/).

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`](https://github.com/giantswarm/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](https://pytest-helm-charts.readthedocs.io/en/latest/examples/basic).

The list of available fixtures can be found by running `pytest --fixtures`, but
you can also just check [the most important fixtures](docs/fixtures.md).

Full [API docs](https://pytest-helm-charts.readthedocs.io/en/latest/api/pytest_helm_charts/)
are also available.

## Contributing

Contributions are very welcome.

- Project is managed with [`poetry`](https://python-poetry.org/),
  to start developing run `poetry install`
- Tests for all supported python versions can be run with [`tox`](https://tox.readthedocs.io/):
  `poetry run tox -- --log-cli-level info tests/`
- Please ensure
  [the coverage](https://codecov.io/gh/giantswarm/pytest-helm-charts/)
  at least stays the same before you submit a pull request.

### Creating a new release

- merge your changes to `master` branch
- edit `pyproject.toml` and update the project version; edit `CHANGELOG.md`; commit
- create a new tag with the same version in git, i.e. `git tag v1.1.1`
- push your changes to GitHub to trigger a release `git push; git push origin v1.1.1`

## License

See [LICENSE](LICENSE).

## Changelog

See [CHANGELOG.md](./CHANGELOG.md).

## Issues

If you encounter any problems, please [file an issue](https://github.com/giantswarm/pytest-helm-charts/issues)
along with a detailed description.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/giantswarm/pytest-helm-charts",
    "name": "pytest-helm-charts",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0.0",
    "maintainer_email": "",
    "keywords": "kubernetes,helm,chart",
    "author": "\u0141ukasz Pi\u0105tkowski",
    "author_email": "lukasz@giantswarm.io",
    "download_url": "https://files.pythonhosted.org/packages/75/b8/83743a63d3a135e939726ef9b9f9c4a2fe281362c3dcb5d637edee001c81/pytest_helm_charts-1.2.0.tar.gz",
    "platform": null,
    "description": "# pytest-helm-charts\n\n[![build](https://github.com/giantswarm/pytest-helm-charts/actions/workflows/main.yml/badge.svg)](https://github.com/giantswarm/pytest-helm-charts/actions/workflows/main.yml/badge.svg)\n[![codecov](https://codecov.io/gh/giantswarm/pytest-helm-charts/branch/master/graph/badge.svg)](https://codecov.io/gh/giantswarm/pytest-helm-charts)\n[![Documentation Status](https://readthedocs.org/projects/pytest-helm-charts/badge/?version=latest)](https://pytest-helm-charts.readthedocs.io/en/latest/?badge=latest)\n[![PyPI Version](https://img.shields.io/pypi/v/pytest-helm-charts.svg)](https://pypi.org/project/pytest-helm-charts/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pytest-helm-charts.svg)](https://pypi.org/project/pytest-helm-charts/)\n[![Apache License](https://img.shields.io/badge/license-apache-blue.svg)](https://pypi.org/project/pytest-helm-charts/)\n\nA plugin to test helm charts on Kubernetes clusters.\n\nFull documentation (including API) available on <https://pytest-helm-charts.readthedocs.io/>.\n\n---\n\n## Features\n\nThis plugin provides a set of [pytest](https://docs.pytest.org/) fixtures that allow you to easily\nwrite tests for Helm charts and run them on Kubernetes clusters.\n\nIt can be also used to test Helm charts deployed using the Open Source\n[Giant Swarm App Platform](https://docs.giantswarm.io/basics/app-platform/).\n\nMost important features:\n\n- provides [pykube-ng](http://pykube.readthedocs.io/) interface to access Kubernetes clusters\n- provides [environment variables based options](#usage) to configure the target cluster to run on\n- provides fixtures to work with some standard Kubernetes resources as well as some custom ones:\n  - [Kubernetes objects](pytest_helm_charts.k8s)\n  - [Giant Swarm App Platform objects](pytest_helm_charts.giantswarm_app_platform)\n  - [Flux CD objects](pytest_helm_charts.flux)\n- provides set of fixtures to easily work with Helm charts\n\n## Requirements\n\nPlease check `[tool.poetry.dependencies]` list in the [`pyproject.toml`](pyproject.toml) file.\n\n## Installation\n\nYou can install \"pytest-helm-charts\" via `pip` from `PyPI`:\n\n```bash\npip install pytest-helm-charts\n```\n\n## Usage\n\n### Running your tests\n\nWhen you want to run your tests, you invoke `pytest` as usual, just configuring\ncluster and chart information using environment variables or command line options.\nThe following options are available as environment variables (start `pytest` with `-h`\nto check corresponding command line options):\n\n- \"KUBECONFIG\" - (mandatory) a path to kube config file used to connect to a k8s cluster\n- \"ATS_CHART_PATH\" - path to a chart being tested (if a chart is tested)\n- \"ATS_CHART_VERSION\" - version of the chart being tested (if a chart is tested)\n- \"ATS_CLUSTER_TYPE\" - type of the cluster used for testing\n- \"ATS_CLUSTER_VERSION\" - k8s version of the cluster used for testing\n- \"ATS_APP_CONFIG_FILE_PATH\" - optional path to a `values.yaml` file used to configure a chart under test\n(if a chart is tested)\n- \"ATS_EXTRA_*\" - any such arbitrary variable value will be extracted and included in the `test_extra_info` fixture\n\nCurrently, the only supported cluster type is `external`, which means the cluster is not\nmanaged by the test suite. You just point the test suite to a `kube.config` file,\nwhich can be used to connect to the Kubernetes API with `KUBECONFIG` env variable\noption. For creating development time clusters, we recommend using\n[KinD](https://kind.sigs.k8s.io/).\n\nIf you use this project to test Helm charts against Giant Swarm App Platform, the `existing`\ncluster must already have the platform components installed. Please refer to and use\nthe [`app-test-suite`](https://github.com/giantswarm/app-test-suite) tool to easily\ncreate `KinD` based clusters with all the components already installed.\n\n### Writing tests\n\nThe easiest way to get started is by checking our\n[examples](https://pytest-helm-charts.readthedocs.io/en/latest/examples/basic).\n\nThe list of available fixtures can be found by running `pytest --fixtures`, but\nyou can also just check [the most important fixtures](docs/fixtures.md).\n\nFull [API docs](https://pytest-helm-charts.readthedocs.io/en/latest/api/pytest_helm_charts/)\nare also available.\n\n## Contributing\n\nContributions are very welcome.\n\n- Project is managed with [`poetry`](https://python-poetry.org/),\n  to start developing run `poetry install`\n- Tests for all supported python versions can be run with [`tox`](https://tox.readthedocs.io/):\n  `poetry run tox -- --log-cli-level info tests/`\n- Please ensure\n  [the coverage](https://codecov.io/gh/giantswarm/pytest-helm-charts/)\n  at least stays the same before you submit a pull request.\n\n### Creating a new release\n\n- merge your changes to `master` branch\n- edit `pyproject.toml` and update the project version; edit `CHANGELOG.md`; commit\n- create a new tag with the same version in git, i.e. `git tag v1.1.1`\n- push your changes to GitHub to trigger a release `git push; git push origin v1.1.1`\n\n## License\n\nSee [LICENSE](LICENSE).\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md).\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/giantswarm/pytest-helm-charts/issues)\nalong with a detailed description.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A plugin to provide different types and configs of Kubernetes clusters that can be used for testing.",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/giantswarm/pytest-helm-charts",
        "Repository": "https://github.com/giantswarm/pytest-helm-charts"
    },
    "split_keywords": [
        "kubernetes",
        "helm",
        "chart"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18736c3cf49846df32d76f091443997f1fae7ef86b65ef79298acf3e07f8a95b",
                "md5": "f775e8f8971cc27d46ed2a03b30d2b85",
                "sha256": "f6baddceee2541bdee5159cccadf0c9d0e04e4a80fc946a407196593d2d844a1"
            },
            "downloads": -1,
            "filename": "pytest_helm_charts-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f775e8f8971cc27d46ed2a03b30d2b85",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 46380,
            "upload_time": "2024-02-07T07:14:27",
            "upload_time_iso_8601": "2024-02-07T07:14:27.506512Z",
            "url": "https://files.pythonhosted.org/packages/18/73/6c3cf49846df32d76f091443997f1fae7ef86b65ef79298acf3e07f8a95b/pytest_helm_charts-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75b883743a63d3a135e939726ef9b9f9c4a2fe281362c3dcb5d637edee001c81",
                "md5": "badd27b78ab6150e5bfd4ad4b580d809",
                "sha256": "f74d4ca7513f176bc4e958100371c41bec023fce0c85747f311a2f2c09741417"
            },
            "downloads": -1,
            "filename": "pytest_helm_charts-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "badd27b78ab6150e5bfd4ad4b580d809",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 32411,
            "upload_time": "2024-02-07T07:14:29",
            "upload_time_iso_8601": "2024-02-07T07:14:29.340992Z",
            "url": "https://files.pythonhosted.org/packages/75/b8/83743a63d3a135e939726ef9b9f9c4a2fe281362c3dcb5d637edee001c81/pytest_helm_charts-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-07 07:14:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "giantswarm",
    "github_project": "pytest-helm-charts",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pytest-helm-charts"
}
        
Elapsed time: 0.17658s