ci: skip duplicate full extension shard

This commit is contained in:
Peter Steinberger
2026-04-08 13:03:18 +01:00
parent 640d39d482
commit 4d2ea434d2
3 changed files with 61 additions and 5 deletions

View File

@@ -551,6 +551,7 @@ jobs:
echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
if [ "$TASK" = "test" ]; then
echo "OPENCLAW_TEST_PROJECTS_PARALLEL=6" >> "$GITHUB_ENV"
echo "OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD=1" >> "$GITHUB_ENV"
fi
if [ "$TASK" = "channels" ]; then
echo "OPENCLAW_VITEST_MAX_WORKERS=1" >> "$GITHUB_ENV"
@@ -946,6 +947,7 @@ jobs:
NODE_OPTIONS: --max-old-space-size=6144
# Keep total concurrency predictable on the 32 vCPU runner.
OPENCLAW_VITEST_MAX_WORKERS: 1
OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD: 1
defaults:
run:
shell: bash

View File

@@ -62,6 +62,7 @@ const EXTENSION_VOICE_CALL_VITEST_CONFIG = "vitest.extension-voice-call.config.t
const EXTENSION_WHATSAPP_VITEST_CONFIG = "vitest.extension-whatsapp.config.ts";
const EXTENSION_ZALO_VITEST_CONFIG = "vitest.extension-zalo.config.ts";
const EXTENSIONS_VITEST_CONFIG = "vitest.extensions.config.ts";
const FULL_EXTENSIONS_VITEST_CONFIG = "vitest.full-extensions.config.ts";
const GATEWAY_VITEST_CONFIG = "vitest.gateway.config.ts";
const HOOKS_VITEST_CONFIG = "vitest.hooks.config.ts";
const INFRA_VITEST_CONFIG = "vitest.infra.config.ts";
@@ -621,6 +622,12 @@ export function buildFullSuiteVitestRunPlans(args, cwd = process.cwd()) {
}
const expandToProjectConfigs = process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS === "1";
return fullSuiteVitestShards.flatMap((shard) => {
if (
process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD === "1" &&
shard.config === FULL_EXTENSIONS_VITEST_CONFIG
) {
return [];
}
const configs = expandToProjectConfigs ? shard.projects : [shard.config];
return configs.map((config) => ({
config,

View File

@@ -196,6 +196,7 @@ describe("scripts/test-projects changed-target routing", () => {
describe("scripts/test-projects full-suite sharding", () => {
it("splits untargeted runs into fixed shard configs", () => {
delete process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
delete process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD;
expect(buildFullSuiteVitestRunPlans([], process.cwd()).map((plan) => plan.config)).toEqual([
"vitest.full-core-unit-fast.config.ts",
@@ -213,14 +214,35 @@ describe("scripts/test-projects full-suite sharding", () => {
]);
});
it("can skip the aggregate extension shard when CI runs dedicated extension shards", () => {
const previous = process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD;
process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = "1";
try {
const configs = buildFullSuiteVitestRunPlans([], process.cwd()).map((plan) => plan.config);
expect(configs).not.toContain("vitest.full-extensions.config.ts");
expect(configs).toContain("vitest.full-auto-reply.config.ts");
} finally {
if (previous === undefined) {
delete process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD;
} else {
process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = previous;
}
}
});
it("can expand full-suite shards to project configs for perf experiments", () => {
const previous = process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = "1";
const plans = buildFullSuiteVitestRunPlans([], process.cwd());
if (previous === undefined) {
delete process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
} else {
process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previous;
let plans: ReturnType<typeof buildFullSuiteVitestRunPlans>;
try {
plans = buildFullSuiteVitestRunPlans([], process.cwd());
} finally {
if (previous === undefined) {
delete process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
} else {
process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previous;
}
}
expect(plans.map((plan) => plan.config)).toEqual([
@@ -290,6 +312,31 @@ describe("scripts/test-projects full-suite sharding", () => {
);
});
it("skips extension project configs when leaf sharding and the aggregate extension shard is disabled", () => {
const previousLeafShards = process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
const previousSkipExtensions = process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD;
process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = "1";
process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = "1";
try {
const configs = buildFullSuiteVitestRunPlans([], process.cwd()).map((plan) => plan.config);
expect(configs).not.toContain("vitest.extensions.config.ts");
expect(configs).not.toContain("vitest.extension-providers.config.ts");
expect(configs).toContain("vitest.auto-reply-reply.config.ts");
} finally {
if (previousLeafShards === undefined) {
delete process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS;
} else {
process.env.OPENCLAW_TEST_PROJECTS_LEAF_SHARDS = previousLeafShards;
}
if (previousSkipExtensions === undefined) {
delete process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD;
} else {
process.env.OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD = previousSkipExtensions;
}
}
});
it("keeps untargeted watch mode on the native root config", () => {
expect(buildFullSuiteVitestRunPlans(["--watch"], process.cwd())).toEqual([
{