perf(test): expand light lane routing

This commit is contained in:
Peter Steinberger
2026-04-06 16:13:16 +01:00
parent c1c1c0f351
commit d7e3df5eaa
9 changed files with 292 additions and 61 deletions

View File

@@ -93,4 +93,64 @@ describe("scripts/test-projects changed-target routing", () => {
},
]);
});
it("routes changed plugin-sdk source allowlist files to sibling light tests", () => {
const plans = buildVitestRunPlans(["--changed", "origin/main"], process.cwd(), () => [
"src/plugin-sdk/lazy-value.ts",
]);
expect(plans).toEqual([
{
config: "vitest.plugin-sdk-light.config.ts",
forwardedArgs: [],
includePatterns: ["src/plugin-sdk/lazy-value.test.ts"],
watchMode: false,
},
]);
});
it("routes changed commands source allowlist files to sibling light tests", () => {
const plans = buildVitestRunPlans(["--changed", "origin/main"], process.cwd(), () => [
"src/commands/status-overview-values.ts",
]);
expect(plans).toEqual([
{
config: "vitest.commands-light.config.ts",
forwardedArgs: [],
includePatterns: ["src/commands/status-overview-values.test.ts"],
watchMode: false,
},
]);
});
it("keeps non-allowlisted plugin-sdk source files on the heavy lane", () => {
const plans = buildVitestRunPlans(["--changed", "origin/main"], process.cwd(), () => [
"src/plugin-sdk/facade-runtime.ts",
]);
expect(plans).toEqual([
{
config: "vitest.plugin-sdk.config.ts",
forwardedArgs: [],
includePatterns: ["src/plugin-sdk/**/*.test.ts"],
watchMode: false,
},
]);
});
it("keeps non-allowlisted commands source files on the heavy lane", () => {
const plans = buildVitestRunPlans(["--changed", "origin/main"], process.cwd(), () => [
"src/commands/channels.add.ts",
]);
expect(plans).toEqual([
{
config: "vitest.commands.config.ts",
forwardedArgs: [],
includePatterns: ["src/commands/**/*.test.ts"],
watchMode: false,
},
]);
});
});