Skip to content

Commit f1a0e04

Browse files
committed
Bound and parallelize CI test gates
1 parent 719ceb4 commit f1a0e04

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
pip install -r requirements.txt
27-
pip install ruff black nbconvert nbformat jupyter-client ipykernel
27+
pip install ruff black nbconvert nbformat jupyter-client ipykernel pytest-xdist
2828
2929
- name: Lint
3030
if: matrix.python-version == '3.12'
@@ -171,8 +171,11 @@ jobs:
171171
run: python scripts/check_cli_contracts.py
172172

173173
- name: Test
174-
run: pytest -q --junitxml=reports/ci/junit_results.xml
175-
continue-on-error: true
174+
# Live integration coverage has its own testnet workflow; PPO training
175+
# is intentionally kept out of the per-push feedback loop.
176+
run: >-
177+
pytest -q -n 2 --dist loadscope --timeout=120 -m "not integration and not slow"
178+
--junitxml=reports/ci/junit_results.xml
176179
177180
- name: Triage build failures (Issue #539)
178181
if: always()
@@ -357,7 +360,10 @@ jobs:
357360
mutation-test:
358361
name: Mutation Testing (≥80% score)
359362
runs-on: ubuntu-latest
360-
# Run mutation testing only on Python 3.11 to keep CI time under 15 minutes.
363+
timeout-minutes: 15
364+
# Run mutation testing only on Python 3.11 and the Benford scoring core.
365+
# Feature/model paths have much heavier fixtures and are covered by the
366+
# normal test matrix; mutating all three made this gate run indefinitely.
361367
# It runs in parallel with the test matrix so it does not block PR feedback.
362368
steps:
363369
- uses: actions/checkout@v4
@@ -372,17 +378,15 @@ jobs:
372378
run: pip install -r requirements.txt
373379

374380
- name: Run mutation tests on core scoring path
375-
# --paths-to-mutate limits scope to the three core modules so the job
376-
# completes in < 15 minutes. Mutmut restores every mutant after testing,
381+
# Keep each mutant paired with the tests that exercise this module.
382+
# Mutmut restores every mutant after testing,
377383
# so no mutated code is ever persisted to disk or the workspace.
378384
run: |
379-
mutmut run \
380-
--paths-to-mutate "detection/benford_engine.py,detection/feature_engineering.py,detection/model_inference.py" \
385+
timeout 10m mutmut run \
386+
--paths-to-mutate "detection/benford_engine.py" \
381387
--runner "python -m pytest -x -q --timeout=30 -m 'not integration and not slow' \
382388
tests/test_benford.py \
383-
tests/test_benford_ci.py \
384-
tests/test_feature_engineering.py \
385-
tests/test_model_inference.py" \
389+
tests/test_benford_ci.py" \
386390
--no-progress || true
387391
388392
- name: Print mutation results summary

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ markers = [
7171
# integration fixtures (train_models, tmp_path_factory) that make mutmut's
7272
# subprocess-based runner very slow. The Makefile target passes it explicitly
7373
# via --paths-to-mutate instead so we can time-box it separately.
74-
paths_to_mutate = "detection/benford_engine.py,detection/feature_engineering.py"
74+
paths_to_mutate = "detection/benford_engine.py"
7575
tests_dir = "tests/"
7676
# Run only the fast unit tests during mutation (skip integration + slow marks)
77-
runner = "python -m pytest -x -q --timeout=30 -m 'not integration and not slow' tests/test_benford.py tests/test_benford_ci.py tests/test_feature_engineering.py tests/test_model_inference.py"
77+
runner = "python -m pytest -x -q --timeout=30 -m 'not integration and not slow' tests/test_benford.py tests/test_benford_ci.py"
7878
# Do not mutate import blocks, type annotations, or docstrings
7979
dict_synonyms = ""
8080
# Avoid mutating auto-generated files or vendored code

0 commit comments

Comments
 (0)