Repository navigation
CI runs the tests as a matrix of shards, keeping the four check names (opensoft/openRepoTools#77) - #22
CI runs the tests as a matrix of shards, keeping the four check names (opensoft/openRepoTools#77)#22brettheap wants to merge 1 commit into
Conversation
What changes. In .github/workflows/tests.yml, `tests` and `tests-no-submodule` become small gate jobs that wait on matrices of shard jobs: `tests-shard` (pytest-1 to pytest-4, and shell) and `tests-no-submodule-shard` (pytest-1 to pytest-3, and shell). .github/ci/ci_shards.py deals tests/test_*.py to the pytest shards, longest first, by the seed seconds in .github/ci/weights.json; a test file with no weight still runs, so adding one needs no edit. The lane helpers' shell suite is one pytest item of about 27 minutes, so it is its own shard and is deselected from the others. `guard-launch-mode` and `package` are unchanged. tests/test_tests_workflow.py is updated to the new shape and tests/test_ci_shards.py is new. Why. The code leg's checks take 58 to 81 minutes because the suite runs serial in one job per variant (opensoft/openRepoTools#77); lane 5's three-wide runs of it are recorded at opensoft/openRepoTools#77 comment 6373986119. Lane 3 ruled on opensoft/openRepoTools#165 (comment 6723967774) that the four required check names stay and that the same test count must show. The four names. The gates keep the names `tests` and `tests-no-submodule`, carry no `name:`, and run with `if: ${{ always() }}`, so a failed or cancelled shard turns the gate red and never skips it (a skipped job would pass a required check). The shard jobs have other names, which the release gate ignores. The rulesets and release.yml need no change. The count. Each shard keeps the node ids it selected and its JUnit report. The gate collects the whole suite as a serial run does and fails unless every shard exited 0, ran what it chose, no id is in two shards, and the shards' ids equal the full collection, id for id. It prints the line a serial run would print, `N passed, M skipped`. A "Re-run failed jobs" attempt is read by attempt number. Estimate. About 30 minutes (28 to 33) for the slowest check, from 58 to 81 minutes; the shell suite alone is 23 to 32 minutes serial and is the floor. Stage 2 is not included. Cutting the shell suite by section, which would bring it to about 13 to 17 minutes, needs a probe that shows which sections run alone, and is a separate change. The planner refuses more than one shell shard for a suite that cannot be cut. Lane: openRepoTools-4 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 6 days and 16 hours by commenting |
Reviewer's GuideUses of the APIReplace the serial test jobs with shard matrices and gate jobs that retain the required check names and verify shard reports.
ConfigurationAdd the shard planner and timing weights that define which pytest files and shell suite sections each CI shard runs.
TestsTest shard planning and report verification, and update workflow assertions for the shard jobs and gates.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|




Lane: openRepoTools-4
Claim: opensoft/openRepoTools#77 (comment)
What this is
This PR is for opensoft/openRepoTools#77. This leg's
testsandtests-no-submodulechecks take 58 to 81 minutes, because each runs the whole suite serially in one job. Here each becomes a gate job over a matrix of shard jobs, and all four required check names stay.This is stage 1 of lane 4's design (opensoft/openRepoTools#165 comment 6724536105).
What changes
.github/workflows/tests.yml:tests-shardrunspytest-1topytest-4andshell;tests-no-submodule-shardrunspytest-1topytest-3andshell;testsandtests-no-submodulebecome the gates over them..github/ci/ci_shards.py, new: itsplan,run,verifyandidscommands.tests/test_*.pyto the pytest shards, longest first, by the seed seconds in.github/ci/weights.json. A test file with no weight still runs, so adding one needs no edit..github/ci/weights.json, new.tests/test_ci_shards.py, new, andtests/test_tests_workflow.py, updated to the new shape.guard-launch-mode,package,release.ymland the rulesets.The four names, and the count
The gates keep the names
testsandtests-no-submodule. They carry noname:.They run with
if: ${{ always() }}. A failed or cancelled shard turns its gate red, and a gate is never skipped. A skipped job would pass a required check.Each shard keeps the node ids it chose and its JUnit report, in an artifact named by run attempt.
The gate collects the whole suite as a serial run does. It fails unless:
It then prints the line a serial run would print,
N passed, M skipped. A "Re-run failed jobs" attempt is read by its attempt number.Estimate
testsand 649 to 651 s fortests-no-submodule. The shell shard is 1,712 s and 1,506 s.Credit
This rests on lane 5's measurements:
Checks before opening
tests.yml, and onrelease.yml.tests.ymlloads with openRepoShape v1.1.1'srepo_shape.load_yamland lists six jobs.ci_shards.py planandids, for both variants:tests/test_*.pyfiles land in exactly one pytest shard;shell.release.ymlalready uses.test_tests_workflow.py's assertions were checked against the committed workflow by script.verifywas exercised over ten synthetic report sets: pass, skips, a missing shard, a failed shard, a duplicate id, and an id extra to or missing from the full collection.Not in this PR
specs/004-migrate-to-triad/contracts/workflows.mdsays the workflow has four jobs, "no fifth", held bytests/test_tests_workflow.py.tests/test_lane_helpers_suite.py:5still saystests.ymlrunspython3 -m pytest tests -q.Review and landing
Lane openRepoTools-3 reviews this PR. It lands only on Brett's word.
🤖 Generated with Claude Code
Summary by Sourcery
Parallelize both CI test suites with validated matrix shards while retaining the four existing required check names.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests: