mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 20:46:57 +02:00
fix(test): ignore local check opt-out in dev wrappers
This commit is contained in:
@@ -99,6 +99,19 @@ describe("scripts/changed-lanes", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("reenables local-check policy for changed typecheck commands", () => {
|
||||
const result = detectChangedLanes(["src/shared/string-normalization.ts"]);
|
||||
const plan = createChangedCheckPlan(result, {
|
||||
env: { OPENCLAW_LOCAL_CHECK: "0", PATH: "/usr/bin" },
|
||||
});
|
||||
|
||||
expect(plan.commands.find((command) => command.args[0] === "tsgo:core")?.env).toMatchObject({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
OPENCLAW_TSGO_SPARSE_SKIP: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("routes core test-only changes to core test lanes only", () => {
|
||||
const result = detectChangedLanes(["src/shared/string-normalization.test.ts"]);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
acquireLocalHeavyCheckLockSync,
|
||||
applyLocalOxlintPolicy,
|
||||
applyLocalTsgoPolicy,
|
||||
resolveLocalHeavyCheckEnv,
|
||||
shouldAcquireLocalHeavyCheckLockForOxlint,
|
||||
shouldAcquireLocalHeavyCheckLockForTsgo,
|
||||
} from "../../scripts/lib/local-heavy-check-runtime.mjs";
|
||||
@@ -22,14 +23,43 @@ const ROOMY_HOST = {
|
||||
};
|
||||
|
||||
function makeEnv(overrides: Record<string, string | undefined> = {}) {
|
||||
return {
|
||||
const env = {
|
||||
...process.env,
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
...overrides,
|
||||
};
|
||||
if (!Object.hasOwn(overrides, "OPENCLAW_LOCAL_CHECK_MODE")) {
|
||||
delete env.OPENCLAW_LOCAL_CHECK_MODE;
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
describe("local-heavy-check-runtime", () => {
|
||||
it("reenables local heavy-check policy for local wrapper entrypoints", () => {
|
||||
expect(resolveLocalHeavyCheckEnv({ OPENCLAW_LOCAL_CHECK: "0", PATH: "/usr/bin" })).toEqual({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
expect(resolveLocalHeavyCheckEnv({ OPENCLAW_LOCAL_CHECK: "false", PATH: "/usr/bin" })).toEqual({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves local-check disablement in CI", () => {
|
||||
expect(
|
||||
resolveLocalHeavyCheckEnv({
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
}),
|
||||
).toEqual({
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("tightens local tsgo runs on constrained hosts", () => {
|
||||
const { args, env } = applyLocalTsgoPolicy([], makeEnv(), CONSTRAINED_HOST);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user