ci: shard core test suite across parallel runner jobs - #325
Merged
Conversation
`npm test` runs ~90 suites serially (~3.5 min) and dominated the PR critical path, so merge-ready time was effectively the linux-baseline wall time. Split the same suite list (derived at run time from package.json's "test" script, so coverage cannot drift) into two round-robin shards and run them on separate runners in parallel with the build/lint job. Shards are intentionally separate runners rather than two background processes on one machine: several auth suites interfere (rate-limit / JWT state) when the suite runs concurrently on a single host. No test coverage is removed; the `npm test` script and its pretest are unchanged for local/release use, and CI runs the identical suite set.
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.
Intent
Shard the CI core test suite (~90 serial suites) into two parallel runner jobs to cut PR merge-ready time, without removing any test coverage. Update branch protection to require the new shard checks.
What Changed
scripts/ci/run-test-shard.cjsto dynamically parse test suites frompackage.jsonand execute round-robin partitions based onSHARD_TOTALandSHARD_INDEX..github/workflows/ci.ymlto run the core test suite across a two-runner matrix job (linux-tests) with payment method split prechecks on shard 0.tests/dev-tooling-scripts.test.tscovering shard script parameter validation, round-robin partitioning, fail-fast behavior, and CI workflow configuration.Risk Assessment
✅ Low: The change cleanly shards the CI core test suites across two matrix runners using a dynamic runner script without modifying local test scripts or reducing test coverage.
Testing
Exercised scripts/ci/run-test-shard.cjs CLI error validation, round-robin distribution, fail-fast error handling on failing suites, and suite coverage invariance on the repository package.json (all 90 suites partitioned into 45 suites per shard with 100% coverage and zero overlaps). Validated .github/workflows/ci.yml linux-tests matrix shard setup and pretest execution. All automated checks passed cleanly.
Evidence: CI Core Test Suite Sharding Validation Evidence
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npx ts-node --transpile-only -P tests/tsconfig.json tests/dev-tooling-scripts.test.tsnpm run test:dev-toolingnpm run test:release-confignode scripts/ci/run-test-shard.cjsparameter validation and fail-fast checksCI workflow.github/workflows/ci.ymlmatrix and runner isolation schema verification✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.