3D engine that AI agents drive
Run the unit tests in eight shards (issue #563)
Nguyen Xuan Andfbc1f7a8e55
diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex 2a8474b0..38460306 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -48,20 +48,20 @@ jobs:- run: npm run tool-cost -- --base "$SIZE_BASE_REF"# `node --test` already runs every file in its own process (Node 24 default, --test-isolation=process), so one pass over- # the files is also the isolation check. Six shards of hashed file names (scripts/shard-test-files.mjs). The light bake tests are heavy, so one shard of three took twice as long as the others.+ # the files is also the isolation check. Eight shards of hashed file names (scripts/shard-test-files.mjs). The light bake tests are heavy, so one shard of three took twice as long as the others.unit:runs-on: ubuntu-latesttimeout-minutes: 15strategy:fail-fast: falsematrix:- shard: [1, 2, 3, 4, 5, 6]+ shard: [1, 2, 3, 4, 5, 6, 7, 8]steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- uses: ./.github/actions/setup# The live MCP tests need build/ and build/mcp.- run: npm run build:lib- - run: mkdir -p coverage && npm run test:coverage -- --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/shard-${{ matrix.shard }}.info --test-reporter=./scripts/test-timing-reporter.mjs --test-reporter-destination=coverage/timings-${{ matrix.shard }}.json $(node scripts/shard-test-files.mjs ${{ matrix.shard }} 6)+ - run: mkdir -p coverage && npm run test:coverage -- --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/shard-${{ matrix.shard }}.info --test-reporter=./scripts/test-timing-reporter.mjs --test-reporter-destination=coverage/timings-${{ matrix.shard }}.json $(node scripts/shard-test-files.mjs ${{ matrix.shard }} 8)- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2if: always()with:diff --git a/changes/563.md b/changes/563.mdnew file mode 100644index 00000000..ee3b62b1--- /dev/null+++ b/changes/563.md@@ -0,0 +1 @@+Run the unit tests in eight shards so a CI run stays under 2.5 minutes (#563).diff --git a/docs/ci.md b/docs/ci.mdindex da3bf2d2..4f3d9d7a 100644--- a/docs/ci.md+++ b/docs/ci.md@@ -10,7 +10,7 @@ All jobs start at once.| --- | --- || `audit` | `npm audit --audit-level=high` || `size` | `npm run size` and `npm run tool-cost` against the pull request base (pull requests only; a release has no base) |-| `unit` (6 shards balanced by measured time, `scripts/shard-test-files.mjs` and `test-timings.json`) | `npm run build:lib`, then `npm run test:coverage` on one sixth of the test files; uploads its lcov and per-file timings |+| `unit` (8 shards balanced by measured time, `scripts/shard-test-files.mjs` and `test-timings.json`) | `npm run build:lib`, then `npm run test:coverage` on one eighth of the test files; uploads its lcov and per-file timings || `coverage` | merges the shard lcov files, writes the summary, compares with `coverage-baseline.json`, uploads `lcov` || `package` | `prepare:release`, `check:links:package`, `smoke:package`, `smoke:mcp-package` || `test` | waits for every job above and fails unless each one succeeded. Branch protection on `main` requires this name. |