From 0d12422418d8c67d984ef52f2b89677ce9a5d600 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 22 Apr 2026 14:23:33 +0100 Subject: [PATCH] ci: consolidate test shard fanout --- scripts/lib/channel-contract-test-plan.mjs | 2 +- scripts/lib/ci-node-test-plan.mjs | 9 +++++- .../channel-contract-test-plan.test.ts | 4 +-- test/scripts/ci-node-test-plan.test.ts | 30 ------------------- 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/scripts/lib/channel-contract-test-plan.mjs b/scripts/lib/channel-contract-test-plan.mjs index e02cc5f29b7..57b541f04f4 100644 --- a/scripts/lib/channel-contract-test-plan.mjs +++ b/scripts/lib/channel-contract-test-plan.mjs @@ -39,7 +39,7 @@ function resolveContractFileWeight(file) { export function createChannelContractTestShards() { const rootDir = "src/channels/plugins/contracts"; - const suffixes = ["a", "b", "c", "d", "e", "f", "g", "h"]; + const suffixes = ["a", "b", "c", "d"]; const groups = Object.fromEntries( ["registry", "core"].flatMap((family) => suffixes.map((suffix) => [`checks-fast-contracts-channels-${family}-${suffix}`, []]), diff --git a/scripts/lib/ci-node-test-plan.mjs b/scripts/lib/ci-node-test-plan.mjs index 8ade2a4cbc9..cf0e4d08bc6 100644 --- a/scripts/lib/ci-node-test-plan.mjs +++ b/scripts/lib/ci-node-test-plan.mjs @@ -65,8 +65,15 @@ function createAutoReplyReplySplitShards() { } } + const shardCounts = { + "auto-reply-reply-agent-runner": 1, + "auto-reply-reply-commands": 2, + "auto-reply-reply-dispatch": 1, + "auto-reply-reply-state-routing": 1, + }; + return Object.entries(groups).flatMap(([groupName, includePatterns]) => { - const shardCount = groupName === "auto-reply-reply-commands" ? 4 : 2; + const shardCount = shardCounts[groupName] ?? 1; return Array.from({ length: shardCount }, (_, index) => ({ shardName: `${groupName}-${String.fromCharCode(97 + index)}`, configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], diff --git a/test/scripts/channel-contract-test-plan.test.ts b/test/scripts/channel-contract-test-plan.test.ts index 9b18fd770e1..e69b4e0de7c 100644 --- a/test/scripts/channel-contract-test-plan.test.ts +++ b/test/scripts/channel-contract-test-plan.test.ts @@ -16,7 +16,7 @@ function listContractTests(rootDir = "src/channels/plugins/contracts"): string[] describe("scripts/lib/channel-contract-test-plan.mjs", () => { it("splits channel contracts into focused shards", () => { - const suffixes = ["a", "b", "c", "d", "e", "f", "g", "h"]; + const suffixes = ["a", "b", "c", "d"]; expect( createChannelContractTestShards().map((shard) => ({ @@ -51,7 +51,7 @@ describe("scripts/lib/channel-contract-test-plan.mjs", () => { const surfaceRegistryFiles = shard.includePatterns.filter((pattern) => pattern.includes("/surfaces-only.registry-backed-shard-"), ); - expect(surfaceRegistryFiles.length).toBeLessThanOrEqual(1); + expect(surfaceRegistryFiles.length).toBeLessThanOrEqual(2); } }); }); diff --git a/test/scripts/ci-node-test-plan.test.ts b/test/scripts/ci-node-test-plan.test.ts index ae28eb238f7..0b54d8c3f2b 100644 --- a/test/scripts/ci-node-test-plan.test.ts +++ b/test/scripts/ci-node-test-plan.test.ts @@ -186,12 +186,6 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => { requiresDist: false, shardName: "auto-reply-reply-agent-runner-a", }, - { - checkName: "checks-node-auto-reply-reply-agent-runner-b", - configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], - requiresDist: false, - shardName: "auto-reply-reply-agent-runner-b", - }, { checkName: "checks-node-auto-reply-reply-commands-a", configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], @@ -204,42 +198,18 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => { requiresDist: false, shardName: "auto-reply-reply-commands-b", }, - { - checkName: "checks-node-auto-reply-reply-commands-c", - configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], - requiresDist: false, - shardName: "auto-reply-reply-commands-c", - }, - { - checkName: "checks-node-auto-reply-reply-commands-d", - configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], - requiresDist: false, - shardName: "auto-reply-reply-commands-d", - }, { checkName: "checks-node-auto-reply-reply-dispatch-a", configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], requiresDist: false, shardName: "auto-reply-reply-dispatch-a", }, - { - checkName: "checks-node-auto-reply-reply-dispatch-b", - configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], - requiresDist: false, - shardName: "auto-reply-reply-dispatch-b", - }, { checkName: "checks-node-auto-reply-reply-state-routing-a", configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], requiresDist: false, shardName: "auto-reply-reply-state-routing-a", }, - { - checkName: "checks-node-auto-reply-reply-state-routing-b", - configs: ["test/vitest/vitest.auto-reply-reply.config.ts"], - requiresDist: false, - shardName: "auto-reply-reply-state-routing-b", - }, ]); });