{"id":21952114,"url":"https://github.com/nuccitheboss/cleantest","last_synced_at":"2025-04-23T04:06:22.866Z","repository":{"id":62270110,"uuid":"541754570","full_name":"NucciTheBoss/cleantest","owner":"NucciTheBoss","description":"A testing framework that brings up clean environments and mini-clusters for developers in a hurry","archived":false,"fork":false,"pushed_at":"2023-05-12T21:26:49.000Z","size":3967,"stargazers_count":11,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T04:06:13.008Z","etag":null,"topics":["hpc","hpc-applications","hpc-clusters","lxd","python","test-automation","test-framework","testing"],"latest_commit_sha":null,"homepage":"https://nuccitheboss.github.io/cleantest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NucciTheBoss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-26T19:38:14.000Z","updated_at":"2023-08-11T07:14:21.000Z","dependencies_parsed_at":"2022-10-29T17:31:08.324Z","dependency_job_id":null,"html_url":"https://github.com/NucciTheBoss/cleantest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NucciTheBoss%2Fcleantest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NucciTheBoss%2Fcleantest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NucciTheBoss%2Fcleantest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NucciTheBoss%2Fcleantest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NucciTheBoss","download_url":"https://codeload.github.com/NucciTheBoss/cleantest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366721,"owners_count":21418772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hpc","hpc-applications","hpc-clusters","lxd","python","test-automation","test-framework","testing"],"created_at":"2024-11-29T06:20:08.959Z","updated_at":"2025-04-23T04:06:22.841Z","avatar_url":"https://github.com/NucciTheBoss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # \"Copyright 2023 Jason C. Nucciarone\"\n[//]: # \"See LICENSE file for licensing details.\"\n\n\u003ch3 align=\"center\"\u003ecleantest\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\nA testing framework for developers who need clean environments in a hurry\n\u003cbr\u003e\n\u003ca href=\"https://nuccitheboss.github.io/cleantest/\"\u003e\u003cstrong\u003eExplore cleantest docs »\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\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\u003cdetails\u003e\n  \u003csummary\u003e :clipboard: \u003ccode\u003etest.py\u003c/code\u003e \u003c/summary\u003e\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) -\u003e None:\n        for name, result in do_something():\n            assert result.exit_code == 0\n```\n\u003c/details\u003e\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 \u0026copy; 2023 Jason C. Nucciarone. 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\u003e We are sort of the way there on fully support multiple Linux distributions.\n\u003e The big hang-up now is just ensuring that the current macros and utilities are\n\u003e compatible with the new distributions and writing integration tests to ensure that\n\u003e the distributions actually work with cleantest.\n\u003e \n\u003e __Note:__ cleantest can boot these new distributions but support might be slightly flaky.\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 -\u003e i.e. an actual specification for hooks.\n* Comprehensive documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuccitheboss%2Fcleantest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuccitheboss%2Fcleantest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuccitheboss%2Fcleantest/lists"}