https://github.com/nuccitheboss/cleantest

A testing framework that brings up clean environments and mini-clusters for developers in a hurry

https://github.com/nuccitheboss/cleantest

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary

Keywords

hpc hpc-applications hpc-clusters lxd python test-automation test-framework testing
Last synced: 6 months ago · JSON representation

Repository

A testing framework that brings up clean environments and mini-clusters for developers in a hurry

Basic Info
Statistics
  • Stars: 11
  • Watchers: 3
  • Forks: 2
  • Open Issues: 5
  • Releases: 2
Topics
hpc hpc-applications hpc-clusters lxd python test-automation test-framework testing
Created over 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

cleantest

A testing framework for developers who need clean environments in a hurry
Explore cleantest docs »

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 Windows - not tested Mac - not tested | | Supported python versions | Python 3.8, 3.9, and 3.10 Wheel - yes| | Supported hypervisors | LXD - yes |

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. 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:

pip install pytest

Here is a test written using cleantest that you can download:

:clipboard: test.py ```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: for name, result in do_something(): assert result.exit_code == 0 ```

With the test file downloaded, run the test using pytest:

commandline pytest test.py

Where to next?

Please the see the documentation for more information on all that you can do with cleantest.

Contributing

Please read through the contributing guidelines 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 © 2023 Jason C. Nucciarone. Please see the Apache-2.0 license for more details.

Roadmap

Here are my (NucciTheBoss's) goals to get cleantest to release version 1.0.0:

We are sort of the way there on fully support multiple Linux distributions. The big hang-up now is just ensuring that the current macros and utilities are compatible with the new distributions and writing integration tests to ensure that the distributions actually work with cleantest.

Note: cleantest can boot these new distributions but support might be slightly flaky.

  • ~~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

Owner

  • Name: Jason Nucciarone
  • Login: NucciTheBoss
  • Kind: user
  • Location: Pittsburgh, PA, USA
  • Company: @canonical

HPC software engineer @canonical and @ubuntu member | I like to create open-source high-performance computing infrastructure and user-space tooling

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 258
  • Total Committers: 3
  • Avg Commits per committer: 86.0
  • Development Distribution Score (DDS): 0.182
Top Committers
Name Email Commits
NucciTheBoss j****e@c****m 211
NucciTheBoss n****g@g****m 46
Jason Nucciarone 4****s@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 32
  • Total pull requests: 21
  • Average time to close issues: 26 days
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.06
  • Average comments per pull request: 0.14
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • NucciTheBoss (32)
Pull Request Authors
  • NucciTheBoss (20)
  • barrettj12 (1)
Top Labels
Issue Labels
Type: Enhancement (19) Priority: Critical (13) Priority: High (12) Type: Bug (4) Priority: Low (4) Type: Refactor (4) Type: Documentation (4) Priority: Medium (3) Good first issue (3) Status: Won't Fix (1) Status: Triage (1) Type: Cleanup (1) Status: Confirmed (1)
Pull Request Labels
Type: Enhancement (12) Type: Refactor (6) Type: Documentation (3) Type: Bug (2) Type: Cleanup (1) Priority: Critical (1) Libraries: OK (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 29 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
pypi.org: cleantest

Clean tests for developers in a hurry

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 29 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 14.3%
Stargazers count: 17.2%
Average: 18.4%
Forks count: 23.2%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • pydantic ==1.9.2
  • pylxd ==2.3.1
setup.py pypi
  • pydantic *
  • pylxd *
.github/workflows/ci.yaml actions
  • actions/checkout v3 composite
  • canonical/setup-lxd v0.1.1 composite
  • get-woke/woke-action v0 composite
pyproject.toml pypi
tests/functional/lxd/local/requirements.txt pypi
  • tabulate ==0.8.10 test