mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:40:44 +00:00
fix(test): serialize changed checks locally
This commit is contained in:
@@ -5,6 +5,7 @@ import { afterEach, describe, expect, it } from "vitest";
|
||||
import { detectChangedLanes } from "../../scripts/changed-lanes.mjs";
|
||||
import {
|
||||
CHANGED_CHECK_VITEST_NO_OUTPUT_TIMEOUT_MS,
|
||||
createChangedCheckChildEnv,
|
||||
createChangedCheckPlan,
|
||||
createChangedCheckVitestEnv,
|
||||
} from "../../scripts/check-changed.mjs";
|
||||
@@ -112,6 +113,15 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("marks changed-check children as covered by the parent heavy-check lock", () => {
|
||||
expect(createChangedCheckChildEnv({ PATH: "/usr/bin" })).toMatchObject({
|
||||
OPENCLAW_OXLINT_SKIP_LOCK: "1",
|
||||
OPENCLAW_TEST_HEAVY_CHECK_LOCK_HELD: "1",
|
||||
OPENCLAW_TSGO_HEAVY_CHECK_LOCK_HELD: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("routes core test-only changes to core test lanes only", () => {
|
||||
const result = detectChangedLanes(["src/shared/string-normalization.test.ts"]);
|
||||
|
||||
|
||||
@@ -527,6 +527,24 @@ describe("scripts/test-projects local heavy-check lock", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("skips the lock when a parent changed gate already holds it", () => {
|
||||
expect(
|
||||
shouldAcquireLocalHeavyCheckLock(
|
||||
[
|
||||
{
|
||||
config: "test/vitest/vitest.unit.config.ts",
|
||||
includePatterns: ["src/infra/vitest-config.test.ts"],
|
||||
watchMode: false,
|
||||
},
|
||||
],
|
||||
{
|
||||
...process.env,
|
||||
OPENCLAW_TEST_HEAVY_CHECK_LOCK_HELD: "1",
|
||||
},
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("allows forcing the lock back on", () => {
|
||||
expect(
|
||||
shouldAcquireLocalHeavyCheckLock(
|
||||
|
||||
Reference in New Issue
Block a user