Repository navigation
Closed
Description
Priority / sequencing
P1 / priority: soon. The cost lands on every push.
Suggested labels
- documentation
- ux
- compatibility
- distribution
Roadmap fields
Status: Ready; Priority: P1; Size: M; Order: (unset); Depends on: (none)
Problem
The test suite (4,746 collected tests) runs too often and too slowly for the signal it adds:
- CI matrix.
test.ymlruns the full suite on 3 OS x 5 Python versions (15 jobs). The last green run (36857043731) used about 72 runner-minutes. Windows jobs take 250s to 650s;windows-latest · py3.10(653s) sets the wall-clock time. - Pre-push. The
pytesthook isalways_run: trueand runs the full suite on every push (about 2m48s locally), which CI then repeats. Themutmuthook also triggers on anytests/*.pychange and runs with--max-children 1. - Serial execution. The suite runs in one process. The slowest tests spawn subprocesses or build git repos and plugin trees per test (session-start hook about 4.3s per test, plugin-packaging setup 3s to 4s per test).
Test-file cleanup (merging fan-outs, fixture scope, duplicate helpers) is tracked separately in #779 Scope D. This issue covers how and where the suite runs.
Expected outcome
- CI wall-clock time and runner-minutes per push both drop measurably, with OS and Python-version coverage that still catches platform-specific breaks.
- Pushing no longer waits on a full-suite run that CI repeats, unless the team decides the local gate is worth its cost.
- The 100% coverage gate and the mutation gate keep their current strength.
Scope
- Matrix. Decide and implement a smaller matrix. Candidate: full suite on
ubuntu-latestacross all 5 Python versions, plusmacos-latestandwindows-lateston the oldest and newest supported Python only (15 to 9 jobs). Check which tests are OS-specific (path handling, JetBrains/VS Code dirs, subprocess quoting) and confirm they still run on every OS kept. - Coverage on one job. Measure whether running
--covwith--cov-fail-under=100on a single job (the one with thetreesitterextra) and plainpytestelsewhere saves meaningful time. Keep it only if it does. - Parallel runs. Evaluate
pytest-xdist(or the current equivalent) for CI and pre-push: measure the wall-clock gain, check that it works with pytest-cov and the 100% gate, and check mutmut still runs (mutmut stays single-worker on macOS). Adopt it only with numbers showing it helps, pinned per the repo toolchain-pin rules (pyproject extra plus the pre-commit hook dependency lists). - Pre-push pytest hook. Decide between keeping the full run, scoping it to tests affected by the pushed change, or dropping it in favour of CI. Record the decision and the reason in the hook comment.
- Pre-push mutmut trigger. Narrow the
files:regex so a change to a test file unrelated to a mutated module does not trigger the hook, ifcheck_mutation_gate.py --changed-onlydoes not already make that a no-op. Measure first.
Acceptance criteria
- The PR states before/after numbers for: CI wall-clock time, total runner-minutes for one
test.ymlrun, and local pre-push time. - Every OS-specific test still runs on the OS it targets.
- The oldest and newest supported Python versions are tested on every OS kept in the matrix.
- The 100% coverage gate still runs on at least one job with the
treesitterextra installed. - The mutation gate behaviour is unchanged (same modules, same no-new-survivors rule).
- Any new tool is pinned to an exact version in the repo and used by both CI and the pre-commit hooks.
Test plan
- Push a branch and record the
test.ymljob durations before and after. - Time
git pushwith the pre-push hooks on a test-only change and on asrc/change, before and after. - Push a deliberate Windows-only path regression on a scratch branch and confirm the reduced matrix still fails it.
Context
- Measured on 2026-10-01 from
chore/deps-dependabot-rollup(7abc919): 4,746 collected tests, 2,791 distinct test functions, full local run 2m48s. - Line coverage needs only 641 of the tests that execute
src/code (greedy set cover over per-test coverage contexts). Per-test coverage data on Python 3.14 needsCOVERAGE_CORE=ctrace, because the defaultsysmoncore misattributes lines to tests. - Related: [Task]: remove duplicated helpers, stop shipping the conformance harness, slim the test suite (over-engineering audit) #779 (test-file over-engineering cleanup, Scope D).
Metadata
Metadata
Assignees
Labels
No labels
Activity
ci(tests): fix parallel flakiness at the root and run xdist with --di…
sumithr commentedon Oct 2, 2026
Finish proof, head 5c5f87b
CI: 27 of 27 checks pass on 5c5f87b (9 pytest jobs). Mutation gate: run 37058420037 on this head, success. Open review threads: 0.
Per-file review (sumo-qa-reviewing-before-merge, each changed file's full post-change content vs main): SAFE for all 25 files. One low note, not a code defect:
src/sumo_qa/external_skills.pycarries a user-visible fix (the provenance lock is read only under its guard; an unsearchable lock folder is refused before the fetch), and theci(tests): ...squash title gives it no release-please changelog entry./code-review (high): 4 rounds plus a comment-only round (03ea8be, 5c5f87b: the mutmut hazard classifier's comments now match its rule, history sentence removed). Final delta: clean.
Behaviour ledger (finish-pr 4.7):
gh run view <id> --json jobssummed (ci_minutes.py) on main run 37014740621 vs this branch's run; pre-commit pre-push stage timed on a test-only and a src change, before (042c013) vs afterinstaller.pyPATH split on ":" instead of os.pathsep, test.yml run 37057716159 on the reduced matrixpytest (ubuntu-latest · py3.14)logpip install -e ".[dev,vertex,treesitter]",SUMO_QA_REQUIRE_TREESITTER: 1,repo_map_treesitter.py 36 0 100%,Required test coverage of 100% reached. Total coverage: 100.00%git diff origin/main...branchon mutation.yml, check_mutation_gate.py, mutmut-baseline.json, [tool.mutmut]--ignore=tests/test_conformance_redos_subprocess.py(a new subprocess-spawning test, markermutmut-subprocess-spawning, same pattern as the existing ignores); mutation.yml run 37058420037 on the head: successpytest-xdist==3.8.0in the dev extra and the hook's additional_dependencies; hook entrypytest -n auto --maxprocesses 4 --dist loadfile; CI jobs runpytest -n auto --dist loadfile; lockstep row in test_toolchain_pin_lockstep.pyclaude -p(sumo-qa only, no host skills): "load the QA classifications" ->sumo_qa_load_classifications(2297 B) and "is playwright-e2e installed" ->sumo_qa_check_external_skill_installedgive identical tool sequences and byte-identical results on both builds; repos stayed clean. The lock-present path is covered by the new tests in tests/test_external_skills_provenance.py, not this run.Acceptance criteria (#787): all 6 met, evidence per row above (numbers are in the PR body's "How it was verified" table).