Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
19 of 36 tasks
evanroyrees opened this issue Jun 3, 2020 · 1 comment · Fixed by #101 or #120
Open
19 of 36 tasks

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

evanroyrees opened this issue Jun 3, 2020 · 1 comment · Fixed by #101 or #120
Assignees
Labels
enhancement New feature or request stretch wonderful for the community, yet may not be top priority

Comments

@evanroyrees
Copy link
Collaborator

evanroyrees commented Jun 3, 2020

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:

  • Eukarya, Viruses, Bacteria, Archaea, Unclassified - taxonomy-specific
  • Bacterial markers - marker-specific (43 contigs contain all unique 139 markers)
  • Archaeal markers - marker-specific (8 contigs contain all unique 164 markers)
  • Contigs with pre-assigned target genomes - binning assessment (determinism)

Associated data to mock for CI/CD

  • blast output - skip diamond blastp
  • blast hits assigned taxids - skip parsing accession2taxid.gz
  • Read alignments to contigs - skip read alignment
  • ncbi databases - skip download/formatting of databases
  • marker database - skip download/formatting of marker databases
  • hmmscan table - skip search with hmmscan

Unit test implementations

Common

  • test_metagenome.py 🛠️
  • test_metabin.py
  • test_coverage.py
  • test_kmers.py
  • test_markers.py

External

  • test_diamond.py
  • test_prodigal.py
  • test_bowtie.py
  • test_samtools.py
  • test_hmmer.py
  • test_bedtools.py

Config

  • test_user.py
  • test_project.py
  • test_databases.py
  • test_environ.py

Taxonomy

  • test_lca.py
  • test_majority_vote.py
  • test_ncbi.py
  • test_vote.py

Binning

  • test_recursive_dbscan.py
  • test_unclustered_recruitment.py
  • test_summary.py

Integration test implementations

  • test_imports.py
  • test_entrypoints.py
  • test docker
  • test bioconda build
@evanroyrees evanroyrees added enhancement New feature or request stretch wonderful for the community, yet may not be top priority labels Jun 3, 2020
@evanroyrees evanroyrees self-assigned this Jun 5, 2020
@evanroyrees
Copy link
Collaborator Author

evanroyrees commented Jun 16, 2020

Note: For adding pre-commits with CI:

💚 https://pre-commit.com/#usage-in-continuous-integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stretch wonderful for the community, yet may not be top priority
Projects
None yet
2 participants