The test suite
All tests run as part of CI via GitHub Actions. To run them locally, clone the repository and activate the conda environment:
git clone https://github.com/artic-network/fieldbioinformatics
cd fieldbioinformatics
conda env create -f environment.yml
conda activate artic
Unit tests
Unit tests cover the core Python modules. Tests are located in tests/ and are discovered automatically via the pyproject.toml configuration. To run all unit tests:
pytest
To exclude slow tests (see below):
pytest -m "not slow"
The unit tests cover:
align_trim— amplicon soft clipping and alignment filteringartic_vcf_filter— variant quality and allele frequency filteringartic_mask— coverage maskingartic_get_models— model download logicutils— scheme fetching, model selection, primer direction, and related utilitiespipeline— CLI argument parsing and pipeline exit code handling
Pipeline tests
To test the full pipeline end-to-end, use the test-runner.sh script:
./test-runner.sh clair3
This downloads a small subset of an Ebola virus amplicon sequencing run (flongle) from artic.s3.climb.ac.uk and runs the complete pipeline against it.
Variant validation tests
The validation tests download reference SARS-CoV-2 datasets, run the full workflow, and validate the reported variants and consensus sequences against known truth sets. These tests require internet access and are marked slow in the pytest configuration, so they are excluded from the default pytest run.
To run them explicitly:
pytest -m slow