<h3 align="center">cleantest</h3>
<p align="center">
A testing framework for developers who need clean environments in a hurry
<br>
<a href="https://nuccitheboss.github.io/cleantest/"><strong>Explore cleantest docs ยป</strong></a>
</p>
## About
cleantest is a testing framework for quickly bringing up testing environments using the test authors hypervisor of choice. It was created out of NucciTheBoss's desire to efficiently test snap packages, Python code, and Juju charms without needing to make potentially system breaking modifications to the underlying host operating system.
Below is an outline of currently supported operating systems, Python versions, and hypervisors:
|||
| :--- | :---: |
| Supported operating systems | ![Linux - yes](https://img.shields.io/badge/Linux-yes-green) ![Windows - not tested](https://img.shields.io/badge/Windows-not%20tested-red) ![Mac - not tested](https://img.shields.io/badge/Mac-not%20tested-red) |
| Supported python versions | ![Python 3.8, 3.9, and 3.10](https://img.shields.io/pypi/pyversions/cleantest) ![Wheel - yes](https://img.shields.io/pypi/wheel/cleantest)|
| Supported hypervisors | ![LXD - yes](https://img.shields.io/badge/LXD-yes-green) |
## Getting started
### Installing cleantest
The recommended way to install cleantest is by downloading the published package on PyPI:
```commandline
pip install cleantest
```
For those who wish to use the latest, bleeding-edge, and potentially *unstable* version cleantest of cleantest, the
following command can be used to install cleantest from the main branch of this repository:
```commandline
git clone https://github.com/NucciTheBoss/cleantest.git
cd cleantest
python3 -m pip install .
```
### Configuring a test environment provider
Before you can start using cleantest to run tests, you need to set up a test environment provider. Currently, the only
supported environment provider is [LXD](https://ubuntu.com/lxd). You can set LXD up on your system using the following
commands:
```commandline
sudo snap install lxd
lxd init --auto
```
### Run your first test
You can use any testing framework of your choice with cleantest, but this example will use
[pytest](https://docs.pytest.org/en/7.2.x/):
```
pip install pytest
```
Here is a test written using cleantest that you can download:
<details>
<summary> :clipboard: <code>test.py</code> </summary>
```python
#!/usr/bin/env python3
"""A basic test"""
from cleantest.provider import lxd
@lxd(preserve=False)
def do_something():
import sys
try:
import urllib
sys.exit(0)
except ImportError:
sys.exit(1)
class TestSuite:
def test_do_something(self) -> None:
result = do_something()
assert result.exit_code == 0
```
</details>
With the test file downloaded, run the test using pytest:
```commandline
pytest test.py
```
### Where to next?
Please the see the [documentation](https://nuccitheboss.github.io/cleantest/) for more information on all that you can
do with cleantest.
## Contributing
Please read through the [contributing guidelines](https://github.com/NucciTheBoss/cleantest/blob/main/CONTRIBUTING.md)
if you are interested in contributing to cleantest. Included are guidelines for opening issues, code formatting
standards, and how to submit contributions to cleantest.
## License
Code and documentation copyright © 2022 Jason C. Nucciarone, Canonical Ltd. Please see the
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) license for more details.
## Roadmap
Here are my (NucciTheBoss's) goals to get cleantest to release version 1.0.0:
* ~~Add support for injecting tests into LXD~~
* Add support for multiple distros:
* ~~Ubuntu~~
* Debian
* CentOS
* Rocky
* Fedora
* Arch
* ~~Enable support for running parallel tests with LXD~~
* Better test logging capabilities
* Support for a select few popular packaging formats:
* ~~Snap~~
* ~~Pip~~
* ~~Charm libraries~~
* Debs, Rpms, Pacs, etc.
* ~~Apptainer~~
* Robust hook mechanism -> i.e. an actual specification for hooks.
* Comprehensive documentation
Raw data
{
"_id": null,
"home_page": "https://github.com/NucciTheBoss/cleantest",
"name": "cleantest",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "testing,framework,continuous integration",
"author": "Jason C. Nucciarone",
"author_email": "jason.nucciarone@canonical.com",
"download_url": "https://files.pythonhosted.org/packages/0e/0c/611c4d3bca318f2c679720c6ed43f4fa752c6fa97bcca81614651e317fc0/cleantest-0.3.0.tar.gz",
"platform": null,
"description": "<h3 align=\"center\">cleantest</h3>\n\n<p align=\"center\">\nA testing framework for developers who need clean environments in a hurry\n<br>\n<a href=\"https://nuccitheboss.github.io/cleantest/\"><strong>Explore cleantest docs \u00bb</strong></a>\n</p>\n\n## About\n\ncleantest is a testing framework for quickly bringing up testing environments using the test authors hypervisor of choice. It was created out of NucciTheBoss's desire to efficiently test snap packages, Python code, and Juju charms without needing to make potentially system breaking modifications to the underlying host operating system.\n\nBelow is an outline of currently supported operating systems, Python versions, and hypervisors:\n\n|||\n| :--- | :---: |\n| Supported operating systems | ![Linux - yes](https://img.shields.io/badge/Linux-yes-green) ![Windows - not tested](https://img.shields.io/badge/Windows-not%20tested-red) ![Mac - not tested](https://img.shields.io/badge/Mac-not%20tested-red) |\n| Supported python versions | ![Python 3.8, 3.9, and 3.10](https://img.shields.io/pypi/pyversions/cleantest) ![Wheel - yes](https://img.shields.io/pypi/wheel/cleantest)|\n| Supported hypervisors | ![LXD - yes](https://img.shields.io/badge/LXD-yes-green) |\n\n## Getting started\n\n### Installing cleantest\n\nThe recommended way to install cleantest is by downloading the published package on PyPI:\n\n```commandline\npip install cleantest\n```\n\nFor those who wish to use the latest, bleeding-edge, and potentially *unstable* version cleantest of cleantest, the\nfollowing command can be used to install cleantest from the main branch of this repository:\n\n```commandline\ngit clone https://github.com/NucciTheBoss/cleantest.git\ncd cleantest\npython3 -m pip install .\n```\n\n### Configuring a test environment provider\n\nBefore you can start using cleantest to run tests, you need to set up a test environment provider. Currently, the only \nsupported environment provider is [LXD](https://ubuntu.com/lxd). You can set LXD up on your system using the following \ncommands:\n\n```commandline\nsudo snap install lxd\nlxd init --auto\n```\n\n### Run your first test\n\nYou can use any testing framework of your choice with cleantest, but this example will use \n[pytest](https://docs.pytest.org/en/7.2.x/):\n\n```\npip install pytest\n```\n\nHere is a test written using cleantest that you can download:\n\n<details>\n <summary> :clipboard: <code>test.py</code> </summary>\n\n```python\n#!/usr/bin/env python3\n\n\"\"\"A basic test\"\"\"\n\nfrom cleantest.provider import lxd\n\n\n@lxd(preserve=False)\ndef do_something():\n import sys\n\n try:\n import urllib\n sys.exit(0)\n except ImportError:\n sys.exit(1)\n\n\nclass TestSuite:\n def test_do_something(self) -> None:\n result = do_something()\n assert result.exit_code == 0\n```\n</details>\n\nWith the test file downloaded, run the test using pytest:\n\n```commandline\npytest test.py\n```\n\n### Where to next?\n\nPlease the see the [documentation](https://nuccitheboss.github.io/cleantest/) for more information on all that you can \ndo with cleantest.\n\n## Contributing\n\nPlease read through the [contributing guidelines](https://github.com/NucciTheBoss/cleantest/blob/main/CONTRIBUTING.md) \nif you are interested in contributing to cleantest. Included are guidelines for opening issues, code formatting \nstandards, and how to submit contributions to cleantest.\n\n## License\n\nCode and documentation copyright © 2022 Jason C. Nucciarone, Canonical Ltd. Please see the \n[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html) license for more details.\n\n## Roadmap\n\nHere are my (NucciTheBoss's) goals to get cleantest to release version 1.0.0:\n\n* ~~Add support for injecting tests into LXD~~\n* Add support for multiple distros:\n * ~~Ubuntu~~\n * Debian\n * CentOS\n * Rocky\n * Fedora\n * Arch\n* ~~Enable support for running parallel tests with LXD~~\n* Better test logging capabilities\n* Support for a select few popular packaging formats:\n * ~~Snap~~\n * ~~Pip~~\n * ~~Charm libraries~~\n * Debs, Rpms, Pacs, etc.\n * ~~Apptainer~~\n* Robust hook mechanism -> i.e. an actual specification for hooks.\n* Comprehensive documentation\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Clean tests for developers in a hurry",
"version": "0.3.0",
"split_keywords": [
"testing",
"framework",
"continuous integration"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "928b813db34c4af84dfebf100db24e52",
"sha256": "b01359065aa82c584101277045002561fa8ad70acd64784d17a12ae5d69df944"
},
"downloads": -1,
"filename": "cleantest-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "928b813db34c4af84dfebf100db24e52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 50340,
"upload_time": "2022-12-26T02:13:20",
"upload_time_iso_8601": "2022-12-26T02:13:20.060345Z",
"url": "https://files.pythonhosted.org/packages/15/b2/653cbba49b274df1a900eac227444f9d6cbf5a983d16fec8d5d561d8c080/cleantest-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "01497f6ac4b75ab144404ce4f0045e2f",
"sha256": "e325e90fb37d03f207125aa210128c4accf15b2f72c697bc6b70c057941d77fe"
},
"downloads": -1,
"filename": "cleantest-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "01497f6ac4b75ab144404ce4f0045e2f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 35487,
"upload_time": "2022-12-26T02:13:22",
"upload_time_iso_8601": "2022-12-26T02:13:22.262943Z",
"url": "https://files.pythonhosted.org/packages/0e/0c/611c4d3bca318f2c679720c6ed43f4fa752c6fa97bcca81614651e317fc0/cleantest-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-26 02:13:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "NucciTheBoss",
"github_project": "cleantest",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "cleantest"
}