mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:20:43 +00:00
fix(test): keep local Vitest checks serialized
This commit is contained in:
@@ -58,6 +58,38 @@ describe("scripts/run-vitest", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("reenables local check policy for local Vitest children", () => {
|
||||
expect(
|
||||
resolveVitestSpawnParams(
|
||||
{
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
},
|
||||
"darwin",
|
||||
).env,
|
||||
).toMatchObject({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves explicit local-check disablement in CI", () => {
|
||||
expect(
|
||||
resolveVitestSpawnParams(
|
||||
{
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
},
|
||||
"linux",
|
||||
).env,
|
||||
).toMatchObject({
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("caps native Rust worker pools for serial Vitest runs", () => {
|
||||
expect(
|
||||
resolveVitestSpawnParams(
|
||||
|
||||
@@ -1,11 +1,37 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
resolveLocalVitestEnv,
|
||||
resolveLocalFullSuiteProfile,
|
||||
resolveLocalVitestScheduling,
|
||||
shouldUseLargeLocalFullSuiteProfile,
|
||||
} from "../../scripts/lib/vitest-local-scheduling.mjs";
|
||||
|
||||
describe("vitest local full-suite profile", () => {
|
||||
it("forces local Vitest runs back onto local-check policy", () => {
|
||||
expect(resolveLocalVitestEnv({ OPENCLAW_LOCAL_CHECK: "0", PATH: "/usr/bin" })).toEqual({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
expect(resolveLocalVitestEnv({ OPENCLAW_LOCAL_CHECK: "false", PATH: "/usr/bin" })).toEqual({
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps local-check disablement for CI Vitest runs", () => {
|
||||
expect(
|
||||
resolveLocalVitestEnv({
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
}),
|
||||
).toEqual({
|
||||
CI: "true",
|
||||
OPENCLAW_LOCAL_CHECK: "0",
|
||||
PATH: "/usr/bin",
|
||||
});
|
||||
});
|
||||
|
||||
it("selects the large local profile on roomy hosts that are not throttled", () => {
|
||||
const env = {};
|
||||
const hostInfo = {
|
||||
|
||||
Reference in New Issue
Block a user