mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(test): recognize CI env aliases (#111521)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import os from "node:os";
|
||||
|
||||
const MAX_LOCAL_FULL_SUITE_PARALLELISM = 10;
|
||||
const TRUTHY_ENV_VALUES = new Set(["1", "true", "yes", "on"]);
|
||||
|
||||
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
||||
|
||||
@@ -27,9 +28,13 @@ function isSystemThrottleDisabled(env) {
|
||||
return normalized === "1" || normalized === "true";
|
||||
}
|
||||
|
||||
function isTruthyEnvValue(value) {
|
||||
return TRUTHY_ENV_VALUES.has(value?.trim().toLowerCase() ?? "");
|
||||
}
|
||||
|
||||
/** @internal Shared repository-script contract. */
|
||||
export function isCiLikeEnv(env = process.env) {
|
||||
return env.CI === "true" || env.GITHUB_ACTIONS === "true";
|
||||
return isTruthyEnvValue(env.CI) || isTruthyEnvValue(env.GITHUB_ACTIONS);
|
||||
}
|
||||
|
||||
/** @internal Shared repository-script contract. */
|
||||
|
||||
@@ -4551,13 +4551,11 @@ function shouldUseLocalFullSuiteParallelByDefault(env = process.env) {
|
||||
if (hasConservativeVitestWorkerBudget(env)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
env.OPENCLAW_TEST_PROJECTS_SERIAL !== "1" && env.CI !== "true" && env.GITHUB_ACTIONS !== "true"
|
||||
);
|
||||
return env.OPENCLAW_TEST_PROJECTS_SERIAL !== "1" && !isCiLikeEnv(env);
|
||||
}
|
||||
|
||||
function shouldExpandLocalFullSuiteShardsByDefault(env = process.env) {
|
||||
return env.CI !== "true" && env.GITHUB_ACTIONS !== "true";
|
||||
return !isCiLikeEnv(env);
|
||||
}
|
||||
|
||||
function parsePositiveInt(value, label) {
|
||||
|
||||
Reference in New Issue
Block a user