mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:20:42 +00:00
fix(test): keep local Vitest checks serialized
This commit is contained in:
@@ -16,6 +16,9 @@ export const DEFAULT_LOCAL_FULL_SUITE_VITEST_WORKERS: number;
|
||||
export const LARGE_LOCAL_FULL_SUITE_VITEST_WORKERS: number;
|
||||
|
||||
export function isCiLikeEnv(env?: Record<string, string | undefined>): boolean;
|
||||
export function resolveLocalVitestEnv(
|
||||
env?: Record<string, string | undefined>,
|
||||
): Record<string, string | undefined>;
|
||||
export function detectVitestHostInfo(): Required<VitestHostInfo>;
|
||||
export function resolveLocalVitestMaxWorkers(
|
||||
env?: Record<string, string | undefined>,
|
||||
|
||||
@@ -24,6 +24,18 @@ export function isCiLikeEnv(env = process.env) {
|
||||
return env.CI === "true" || env.GITHUB_ACTIONS === "true";
|
||||
}
|
||||
|
||||
export function resolveLocalVitestEnv(env = process.env) {
|
||||
const normalizedLocalCheck = env.OPENCLAW_LOCAL_CHECK?.trim().toLowerCase();
|
||||
if (isCiLikeEnv(env) || (normalizedLocalCheck !== "0" && normalizedLocalCheck !== "false")) {
|
||||
return env;
|
||||
}
|
||||
|
||||
return {
|
||||
...env,
|
||||
OPENCLAW_LOCAL_CHECK: "1",
|
||||
};
|
||||
}
|
||||
|
||||
export function detectVitestHostInfo() {
|
||||
return {
|
||||
cpuCount:
|
||||
|
||||
Reference in New Issue
Block a user