mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
test: cover changed runner routing
This commit is contained in:
@@ -172,6 +172,33 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps shared Vitest wiring changes on the broad changed test path", () => {
|
||||
const result = detectChangedLanes(["test/vitest/vitest.shared.config.ts"]);
|
||||
const plan = createChangedCheckPlan(result);
|
||||
|
||||
expect(plan.testTargets).toEqual([]);
|
||||
expect(plan.runChangedTestsBroad).toBe(true);
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps setup changes on the broad changed test path", () => {
|
||||
const result = detectChangedLanes(["test/setup.ts"]);
|
||||
const plan = createChangedCheckPlan(result);
|
||||
|
||||
expect(plan.testTargets).toEqual([]);
|
||||
expect(plan.runChangedTestsBroad).toBe(true);
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
|
||||
it("routes changed extension Vitest configs to only their owning shard", () => {
|
||||
const result = detectChangedLanes(["test/vitest/vitest.extension-discord.config.ts"]);
|
||||
const plan = createChangedCheckPlan(result);
|
||||
|
||||
expect(plan.testTargets).toEqual(["test/vitest/vitest.extension-discord.config.ts"]);
|
||||
expect(plan.runChangedTestsBroad).toBe(false);
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps an empty changed path list as a no-op", () => {
|
||||
const result = detectChangedLanes([]);
|
||||
const plan = createChangedCheckPlan(result);
|
||||
@@ -189,6 +216,7 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.commands).toEqual([
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
]);
|
||||
expect(plan.runChangedTestsBroad).toBe(false);
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
|
||||
@@ -200,6 +228,7 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.commands).toEqual([
|
||||
{ name: "conflict markers", args: ["check:no-conflict-markers"] },
|
||||
]);
|
||||
expect(plan.runChangedTestsBroad).toBe(false);
|
||||
expect(plan.runFullTests).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
buildVitestRunPlans,
|
||||
listFullExtensionVitestProjectConfigs,
|
||||
shouldAcquireLocalHeavyCheckLock,
|
||||
resolveChangedTestTargetPlan,
|
||||
resolveChangedTargetArgs,
|
||||
resolveParallelFullSuiteConcurrency,
|
||||
} from "../../scripts/test-projects.test-support.mjs";
|
||||
@@ -29,6 +30,20 @@ describe("scripts/test-projects changed-target routing", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("keeps test runner implementation edits on runner tests", () => {
|
||||
expect(
|
||||
resolveChangedTestTargetPlan([
|
||||
"scripts/check-changed.mjs",
|
||||
"scripts/test-projects.test-support.d.mts",
|
||||
"scripts/test-projects.test-support.mjs",
|
||||
"test/scripts/changed-lanes.test.ts",
|
||||
]),
|
||||
).toEqual({
|
||||
mode: "targets",
|
||||
targets: ["test/scripts/changed-lanes.test.ts", "test/scripts/test-projects.test.ts"],
|
||||
});
|
||||
});
|
||||
|
||||
it("routes changed extension vitest configs to their own shard", () => {
|
||||
expect(
|
||||
buildVitestRunPlans(["--changed", "origin/main"], process.cwd(), () => [
|
||||
|
||||
Reference in New Issue
Block a user