diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d26a8dd8..e1595b59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1309770..dd47edb8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 8169a4e8..9d9b2772 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/website/src/data/search-index.json b/website/src/data/search-index.json index 0791bfa4..6ba29df8 100644 --- a/website/src/data/search-index.json +++ b/website/src/data/search-index.json @@ -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", diff --git a/website/src/pages/docs/pages-developers.tsx b/website/src/pages/docs/pages-developers.tsx index fa11f412..8305572b 100644 --- a/website/src/pages/docs/pages-developers.tsx +++ b/website/src/pages/docs/pages-developers.tsx @@ -819,7 +819,7 @@ python -m pytest`} head={["Marker", "Meaning"]} rows={[ [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".], + [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."],