mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
ci: skip duplicate full extension shard
This commit is contained in:
@@ -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([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user