perf(ci): parallelize backend pytest with xdist - #1111
Merged
Merged
Conversation
Run the backend suite with pytest-xdist -n auto on the PR gate so the ~3k tests fan across all runner cores instead of running single-threaded. Also drop -v from backend/pytest.ini (it produced thousands of PASSED lines with no diagnostic value). The nightly coverage run (scripts/backend/test.sh) is left serial on purpose.
This was referenced Sep 14, 2026
DerrickF
added a commit
that referenced
this pull request
Sep 15, 2026
Make ts-jest transpile-only (isolatedModules) so jest workers stop re-type-checking the whole project each — the dominant cost of the infra suite (the long pole once backend went parallel in #1111). Add a single 'tsc --noEmit' (npm run build) step to the infra CI job so type safety is preserved on PRs (previously only ts-jest enforced it; tsc ran only in teardown.yml). Workers stay at 2 (the --maxWorkers bump regressed 2.5x in #1112). No const enum in the tree, so isolatedModules is safe. Verified: tsc clean; 178 tests green transpile-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Runs the backend pytest suite (~3k tests across 469 files) with
pytest-xdist -n autoon the PR gate (tests.yml), so it fans across all runner cores instead of running single-threaded — the backend job is the PR long pole, and the same suite re-runs as the deploy gate, so both get faster.Changes
backend/pyproject.toml: addpytest-xdist==3.6.1to dev deps (+ regenerateduv.lock).github/workflows/tests.yml: backend job nowuv run pytest tests/ -n autobackend/pytest.ini: drop-vfrom addopts (thousands of PASSED lines, no diagnostic value)Deliberately NOT changed
scripts/backend/test.sh) stays serial — xdist + coverage combining is a separate change with its own edge cases.Verified
created: 2/2 workers); targetedtests/costs(218) andtests/security(167) green under-n auto. Full suite runs on CI.