Skip to content

Testing

Aleksey Ermolaev edited this page Oct 20, 2026 · 2 revisions

Testing and CI

All test tools are installed by environment.yaml. Activate the environment before running them:

conda activate ChoCallate

pytest

The Python regression suite builds small pysam fixtures in code and exercises the pure-pysam and Cython consensus paths, BAM post-processing, merge, validation, resources, retries, resume/cache and cleanup.

pytest -q tests/python

Build the optional accelerator first to enable the Cython-path cases:

python bin/build_consensus_accel.py
pytest -q tests/python

Without the accelerator, the suite skips the accelerated cases and runs the pure-pysam implementation. Set CHOCALLATE_NO_ACCEL=1 when running bin/generate_consensus.py directly to force the pure-pysam path.

tests/python/test_validation.py runs the Nextflow entry point to check schema, samplesheet, caller, read-group, index-prefix and open-file-limit validation. It needs Nextflow and the pipeline plugins and is skipped when nextflow is not on PATH.

nf-test

The nf-test suite contains module tests and end-to-end pipeline cases. The pipeline cases use the bundled test_run data.

nf-test test

Re-record snapshots after an intentional output change:

nf-test test --update-snapshot

To verify snapshots without recording new ones, use CI mode:

nf-test test --ci

--verbose shows Nextflow output while tests run. The pipeline cases cover merged and per-sample output, all-sites consensus, caller headers, caller failure modes, empty coverage, missing indexes and index staging with stageInMode: copy; module tests additionally cover gVCF block export and the merge chain.

Lint

ruff check .
nextflow lint .
actionlint

All three commands currently pass without warnings.

CI

GitHub Actions runs:

  • ruff
  • nextflow lint
  • actionlint
  • pytest with and without the Cython accelerator
  • nf-test in CI mode
  • Docker image build and smoke tests, including accelerator import and offline plugin resolution

The bundled test_run dataset is a 200-kb slice with 20,000 read pairs, so the end-to-end pipeline case takes about 3 minutes.

Clone this wiki locally