mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:40:43 +00:00
ci: consolidate test shard fanout
This commit is contained in:
@@ -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}`, []]),
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user