Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
alignair --version
alignair doctor
- name: Tests (all but the heavy training tests, which test-heavy runs)
- name: Tests (all but the heavy training tests, which run locally before a release)
run: |
python -m pytest tests -q -n auto -m "not heavy" --cov=alignair \
--cov-report=xml:test-results/coverage.xml --cov-report=json:test-results/coverage.json \
Expand All @@ -49,34 +49,6 @@ jobs:
name: test-results-python-${{ matrix.python-version }}
path: test-results/

# The tests marked heavy train a model, a lab screen or a record cache end to end: minutes each on a 4-CPU runner
# (the longest 7.5 without coverage, 15 under it), past the suite's 300 s per-test limit, and together more than half
# of the suite's time. They run once, here, on 3.12, without coverage and with a 30-minute per-test limit.
test-heavy:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
OMP_NUM_THREADS: "2"
MKL_NUM_THREADS: "2"
PYTHONDONTWRITEBYTECODE: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install (CPU torch + package + test deps)
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install ".[cli,test]"
- name: Heavy training tests
run: python -m pytest tests -q -n auto -m heavy --timeout=1800 --junitxml=test-results/heavy.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: heavy-test-results
path: test-results/

test-independence:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
28 changes: 2 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,10 @@ jobs:
name: release-test-results
path: test-results/

# The heavy training tests (minutes each), as CI runs them: their own job, a 30-minute per-test limit.
test-heavy:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
OMP_NUM_THREADS: "2"
MKL_NUM_THREADS: "2"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install and run the heavy training tests
run: |
python -m pip install --upgrade pip
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[dev]"
python -m pytest tests -q -n auto -m heavy --timeout=1800 --junitxml=test-results/release-heavy-tests.xml
- uses: actions/upload-artifact@v4
if: always()
with:
name: release-heavy-test-results
path: test-results/

# 1. Build the authoritative artifact set ONCE (only after guard + test pass).
build-wheels:
name: wheels on ${{ matrix.os }}
needs: [guard, test, test-heavy, model-validation]
needs: [guard, test, model-validation]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -116,7 +92,7 @@ jobs:
path: ./wheelhouse/*.whl

build-sdist:
needs: [guard, test, test-heavy, model-validation]
needs: [guard, test, model-validation]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ markers = [
"model_validation: Requires pre-fetched checksum-pinned public model artifacts",
"performance: Resource-behavior checks with explicit budgets",
"slow: Slow tests (real model/reference; excluded from fast runs via -m 'not slow')",
"heavy: Trains a model, a lab screen or a record cache end to end, minutes on a 4-CPU CI runner: CI runs them in a job of their own with a longer per-test timeout (-m heavy), the other test jobs without them (-m 'not heavy')",
"heavy: Trains a model, a lab screen or a record cache end to end, minutes each and too heavy for a 4-CPU CI runner: CI leaves them out (-m 'not heavy'); they run locally before a release (pytest -m heavy --timeout=1800)",
]

[tool.coverage.run]
Expand Down
2 changes: 1 addition & 1 deletion website/src/data/search-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
"title": "Layers and markers",
"text": "Testing",
"href": "#/docs/testing?h=markers",
"body": "Every test declares exactly one layer, usually with pytestmark at the top of its module: component (deterministic contracts, with injected inputs where needed), integration (the real simulator, processes, files) or acceptance (public guarantees). Collection fails otherwise (“declare exactly one QA layer”). Five more markers describe what a test needs: slow, <>A real model or reference; leave it out of fast runs with -m \"not slow\".], [heavy, <>Trains a model, a lab screen or a record cache end to end: minutes on a 4-CPU machine. CI runs them in a job of their own (-m heavy --timeout=1800) and the other test jobs with -m \"not heavy\".], [performance, \"Resource behaviour with an explicit budget.\"], [model_validation, \"Needs the pre-fetched, checksum-pinned public models.\"], [claim_evidence, \"A test that a release claim names; added automatically.\"], ] />"
"body": "Every test declares exactly one layer, usually with pytestmark at the top of its module: component (deterministic contracts, with injected inputs where needed), integration (the real simulator, processes, files) or acceptance (public guarantees). Collection fails otherwise (“declare exactly one QA layer”). Five more markers describe what a test needs: slow, <>A real model or reference; leave it out of fast runs with -m \"not slow\".], [heavy, <>Trains a model, a lab screen or a record cache end to end: minutes each, too heavy for a 4-CPU CI runner. CI leaves them out (-m \"not heavy\"); run them locally before a release (pytest -m heavy --timeout=1800).], [performance, \"Resource behaviour with an explicit budget.\"], [model_validation, \"Needs the pre-fetched, checksum-pinned public models.\"], [claim_evidence, \"A test that a release claim names; added automatically.\"], ] />"
},
{
"kind": "heading",
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/docs/pages-developers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ python -m pytest`}
head={["Marker", "Meaning"]}
rows={[
[<code>slow</code>, <>A real model or reference; leave it out of fast runs with <code>-m "not slow"</code>.</>],
[<code>heavy</code>, <>Trains a model, a lab screen or a record cache end to end: minutes on a 4-CPU machine. CI runs them in a job of their own (<code>-m heavy --timeout=1800</code>) and the other test jobs with <code>-m "not heavy"</code>.</>],
[<code>heavy</code>, <>Trains a model, a lab screen or a record cache end to end: minutes each, too heavy for a 4-CPU CI runner. CI leaves them out (<code>-m "not heavy"</code>); run them locally before a release (<code>pytest -m heavy --timeout=1800</code>).</>],
[<code>performance</code>, "Resource behaviour with an explicit budget."],
[<code>model_validation</code>, "Needs the pre-fetched, checksum-pinned public models."],
[<code>claim_evidence</code>, "A test that a release claim names; added automatically."],
Expand Down
Loading