KwanLab / Autometa

Autometa: Automated Extraction of Genomes from Shotgun Metagenomes
https://autometa.readthedocs.io
Other
40 stars 15 forks source link

CI/CD: Automated testing with pytest and mocks #86

Open evanroyrees opened 4 years ago

evanroyrees commented 4 years ago

Continuous Integration / Continuous Deployment (CI/CD)

Provide unit tests and integration tests using pytest and a mock library (could be built-in unittest.mock, pytest.monkeypatch, pytest-mock, etc.)

After implementation of these tests:

  1. πŸ› οΈ 🧰 the pipeline can be continuously tested (automatically) with each pull request and merge. Multiple CI services such as travis-CI, circle-CI, etc. offer their service for free if you are an open source project.
  2. βœ… ❗ ❌ These tests can then be reflected in each PR, similar to how our documentation is now checked with each PR.
  3. πŸ› This will save us the effort of having to manually look through any changes in the code for possible introductions of bugs to the pipeline.
  4. 🎨 Writing these tests requires a slight shift in mindset where exceptions need to be considered before-hand.

Resources:

Legend

Work-in-progress (WIP) πŸ› οΈ

Data for coverage and quick CI/CD

Contigs containing annotations:

Associated data to mock for CI/CD

Unit test implementations

Common

External

Config

Taxonomy

Binning

Integration test implementations

evanroyrees commented 4 years ago

Note: For adding pre-commits with CI:

πŸ’š https://pre-commit.com/#usage-in-continuous-integration