Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: shard related Windows tests within the existing CI budget

[._.]/ Adam Eivy0d9e18fa1c2c
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index da13676d02..47d4223adc 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -493,17 +493,21 @@ minutes. Roughly half of all PR runs went full, so most PRs waited on the
longest of those.
The three test-runner jobs are therefore matrices. The impact job emits
-`server_shards`, `client_shards`, and `windows_shards` — `[1]` for a scoped
-plan and `[1..n]` for a full one, sized by `FULL_SUITE_SHARDS` in
+`server_shards`, `client_shards`, and `windows_shards` — `[1]` for exact-file
+plans and `[1..n]` for full plans. Windows also uses its full matrix for
+related-test plans: a single shared source can select most of the server graph
+and exceed the 15-minute test-step budget on one Windows runner. Matrices are
+sized by `FULL_SUITE_SHARDS` in
`scripts/ci-test-plan.js` (client 3, Windows 3, server 2) — and each job builds
its matrix from that output. The decision has to be made in the planner: a
job-level `if` cannot read the `matrix` context, so a job cannot skip its own
extra shards. `scripts/run-ci-tests.js` turns `CI_SHARD=<index>/<count>` into
Vitest's `--shard`, which slices the file list by path hash — every shard is a
-fixed, disjoint subset, and their union is the complete suite. A scoped plan
-never shards (its handful of files would trip Vitest's shard-count guard) and
-passes no flag at all, so its invocation stays identical to a local
-`npm run test:ci`. Once-only steps — smoke boot, the client build, the
+fixed, disjoint subset, and their union is the complete selected suite. Windows
+related plans retain the same source graph and explicit contracts on every
+shard; only execution is partitioned. Exact-file plans stay on one runner
+(their handful of files can trip Vitest's shard-count guard), and scoped Linux
+plans also retain one runner. Once-only steps — smoke boot, the client build, the
Scalar-removal bundle pin — pin themselves to shard 1; lint is not among them,
because it has its own job (see above). `CI Gate` sees a matrix job as one
`needs` result, so nothing downstream changes; public-repo runner minutes are
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index daef228a70..2ae46d4cef 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -69,7 +69,7 @@ export const sourceReferencePattern = (sourcePath) => (
// Parallel runners per test job on a full plan. Decided here rather than in
// ci.yml because a job-level `if` cannot read the matrix context, so the
-// planner must emit `[1]` for a scoped plan itself. Sizing rationale:
+// planner emits the matrix for scoped plans too. Sizing rationale:
// docs/GITHUB_ACTIONS.md "Full-suite sharding".
export const FULL_SUITE_SHARDS = { server: 2, client: 3, windows: 3 };
@@ -912,7 +912,12 @@ const finishPlan = (plan, options) => ({
shards: {
server: shardIndexes(plan.server.mode, FULL_SUITE_SHARDS.server),
client: shardIndexes(plan.client.mode, FULL_SUITE_SHARDS.client),
- windows: shardIndexes(plan.windowsMode, FULL_SUITE_SHARDS.windows),
+ // Related mode can reach most of the server graph through one shared
+ // source. The explicit selector count does not bound that work: one Windows
+ // runner exceeded the unchanged 15-minute step budget on a TUI handshake
+ // edit. Split execution across the existing matrix without widening or
+ // reducing related-test selection; exact-file plans stay on one runner.
+ windows: shardIndexes(plan.windowsMode === 'related' ? 'full' : plan.windowsMode, FULL_SUITE_SHARDS.windows),
},
});
diff --git a/scripts/ci-test-plan.test.js b/scripts/ci-test-plan.test.js
index 50ad9f7761..9c12704388 100644
--- a/scripts/ci-test-plan.test.js
+++ b/scripts/ci-test-plan.test.js
@@ -943,7 +943,7 @@ describe('CI test impact planner', () => {
expect(re.test("'generate_ltx2xpy'")).toBe(false);
});
- it('fans a full plan out across the configured shards and leaves a scoped plan on one', () => {
+ it('shards full plans and Windows related graphs while keeping exact-file plans on one runner', () => {
expect(shardIndexes('full', 3)).toEqual([1, 2, 3]);
expect(shardIndexes('related', 3)).toEqual([1]);
expect(shardIndexes('files', 3)).toEqual([1]);
@@ -960,6 +960,13 @@ describe('CI test impact planner', () => {
});
const scoped = buildCiTestPlan(['server/services/auth.js'], { trackedFiles: TRACKED });
expect(scoped.shards).toEqual({ server: [1], client: [1], windows: [1] });
+ const relatedWindows = buildCiTestPlan(['server/lib/bufferedSpawn.js'], { trackedFiles: TRACKED });
+ expect(relatedWindows).toMatchObject({ full: false, windowsMode: 'related',
+ windowsSources: ['server/lib/bufferedSpawn.js'],
+ shards: { server: [1], client: [1], windows: [1, 2, 3] } });
+ expect(relatedWindows.windowsFiles).toEqual(WINDOWS_CONTRACT_TESTS.filter(path => TRACKED.includes(path)).sort());
+ const exactWindows = buildCiTestPlan(['server/lib/bufferedSpawn.test.js'], { trackedFiles: TRACKED });
+ expect(exactWindows).toMatchObject({ windowsMode: 'files', shards: { windows: [1] } });
const docsOnly = buildCiTestPlan(['docs/README.md'], { trackedFiles: TRACKED });
expect(docsOnly.shards).toEqual({ server: [1], client: [1], windows: [1] });
});