fix(test): recognize CI env aliases (#111521)

This commit is contained in:
Peter Steinberger
2026-07-19 12:44:18 -07:00
committed by GitHub
parent 06480d767c
commit 50114c5163
4 changed files with 52 additions and 22 deletions
+6 -1
View File
@@ -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. */
+2 -4
View File
@@ -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) {