-
Notifications
You must be signed in to change notification settings - Fork 58
Testing
This page describes how AlphaPulldown tests are organized, what runs in CI, where to find coverage reports, and which checks still require explicit cluster or manual validation before a release.
AlphaPulldown uses pytest for active CPU-side testing. The test tree is split by purpose:
-
test/unit/: fast unit tests for pure helpers and small mocked components. -
test/integration/: CPU-only integration tests for filesystem, CLI, and module wiring. -
test/functional/: deterministic package-level tests that are heavier than unit/integration. -
test/cluster/: Slurm, GPU, and workstation smoke tests, wrappers, and cluster-only utilities. -
test/alphalink/: AlphaLink fixtures and optional-test support files used by AlphaLink helper tests and smoke runs. -
test/outdated/: legacy tests kept only as a migration area; they are not part of default collection. -
test/test_data/: shared fixtures used by the active suites.
See also:
-
test/README.mdfor the maintained test layout -
test/RELEASE_READINESS.mdfor the practical release gate and the difference between always-on CI coverage and explicit cluster/manual validation
The active pytest.ini markers are:
-
unit: fast unit tests -
integration: CPU-only integration tests -
functional: heavier but deterministic package tests -
cluster: tests intended for cluster execution -
gpu: tests that require a GPU -
slow: intentionally slow tests -
external_tools: tests that need optional heavyweight tools -
network: tests that need network access
By default, local pytest runs exclude:
not cluster and not gpu and not network and not external_toolsThis keeps the default suite CPU-only and CI-friendly.
Install the test dependencies:
pip install -e .[test]Run the default active CPU suite:
pytestRun only unit tests in parallel:
pytest -n auto --dist loadfile test/unitRun the CPU CI-equivalent suite:
pytest -n auto --dist loadfile test/unit
pytest test/integrationRun coverage locally:
pytest -n auto --dist loadfile test/unit \
--cov=alphapulldown \
--cov-config=.coveragerc \
--cov-report=
pytest test/integration \
--cov=alphapulldown \
--cov-config=.coveragerc \
--cov-append \
--cov-report=
coverage report --skip-covered --show-missing
coverage xml -o coverage.xml
coverage json -o coverage.json
coverage html -d htmlcov
python test/tools/check_function_coverage.py --report-only coverage.jsonRun cluster or GPU smoke wrappers explicitly on a suitable environment:
python test/cluster/run_alphafold2_predictions.py
python test/cluster/run_alphafold3_predictions.pySome MMseqs-backed functional or cluster checks are intentionally opt-in:
export RUN_MMSEQS_FUNCTIONAL_TESTS=1Coverage is scoped to the alphapulldown/ package via .coveragerc.
- Vendored or nested projects such as
alphafold,alphafold3,ColabFold, andAlphaLink2are out of scope. -
alphapulldown/analysis_pipeline/af2plotsis omitted from package coverage.
There are two coverage views:
- Standard line and branch coverage from
pytest-cov - A separate AST-based function coverage report from
test/tools/check_function_coverage.py
The function coverage script is currently report-only. It helps identify functions that are still never executed by the active CPU suites, but should be treated as an audit signal rather than proof of workflow correctness.
The main GitHub Actions workflow runs the following jobs:
Runs on Python 3.10 and 3.11:
pytest -n auto --dist loadfile test/unit
pytest test/integrationThese jobs are CPU-only and do not collect coverage.
Runs on Python 3.11:
- unit coverage pass
- integration coverage pass with
--cov-append - coverage report
- coverage xml
- coverage json
- coverage html
- AST function coverage report
The coverage job enforces the package coverage floor configured in the workflow.
The workflow also builds AlphaFold2 and AlphaFold3 containers.
These are useful packaging checks, but they are not substitutes for explicit cluster/GPU inference smoke tests.
After a coverage run:
-
terminal summary:
coverage report --skip-covered --show-missing
-
XML report:
coverage.xml -
JSON report:
coverage.json -
HTML report:
htmlcov/index.html
Open the coverage job and download the coverage-reports artifact. It contains:
coverage.jsoncoverage.xmlhtmlcov/
On pushes to main, the HTML coverage report is also published via GitHub Pages.
GPU inference and Slurm wrapper tests are intentionally not part of default CI because GitHub-hosted runners do not provide GPUs or Slurm.
These tests live under test/cluster/ and must be run explicitly on an appropriate cluster environment.
Examples of release-critical checks that require cluster/manual validation:
- AF3 wrapper output isolation for combined JSON folds
- MMseqs-generated
.a3mand.pkl/.pkl.xzfeature artifacts - AF3 species-pairing regressions (e.g. issue #588)
- AF2/AF3 dimer inference sanity (e.g.
ipTM > 0.6)
The current direction is to favor:
- direct unit tests for simple helpers
- CPU-only integration tests for wiring and module interaction
- explicit GPU/cluster smoke tests only where real inference is needed
This keeps CI reasonably fast while still improving real coverage of alphapulldown/.
The package metadata currently advertises Python ≥3.8, but GitHub Actions exercises Python 3.10 and 3.11.
If Python 3.8 remains a supported target, it should be treated as a compatibility commitment beyond the current CI matrix.