mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: keep conservative full-suite shards aggregated
This commit is contained in:
@@ -644,6 +644,9 @@ export function buildFullSuiteVitestRunPlans(args, cwd = process.cwd()) {
|
||||
}
|
||||
|
||||
export function shouldUseLocalFullSuiteParallelByDefault(env = process.env) {
|
||||
if (hasConservativeVitestWorkerBudget(env)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
env.OPENCLAW_TEST_PROJECTS_SERIAL !== "1" && env.CI !== "true" && env.GITHUB_ACTIONS !== "true"
|
||||
);
|
||||
@@ -654,6 +657,13 @@ function parsePositiveInt(value) {
|
||||
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
||||
}
|
||||
|
||||
function hasConservativeVitestWorkerBudget(env) {
|
||||
const workerBudget = parsePositiveInt(
|
||||
env.OPENCLAW_VITEST_MAX_WORKERS ?? env.OPENCLAW_TEST_WORKERS,
|
||||
);
|
||||
return workerBudget !== null && workerBudget <= 1;
|
||||
}
|
||||
|
||||
export function resolveParallelFullSuiteConcurrency(specCount, env = process.env) {
|
||||
const override = parsePositiveInt(env.OPENCLAW_TEST_PROJECTS_PARALLEL);
|
||||
if (override !== null) {
|
||||
@@ -665,10 +675,7 @@ export function resolveParallelFullSuiteConcurrency(specCount, env = process.env
|
||||
if (env.CI === "true" || env.GITHUB_ACTIONS === "true") {
|
||||
return 1;
|
||||
}
|
||||
const workerBudget = parsePositiveInt(
|
||||
env.OPENCLAW_VITEST_MAX_WORKERS ?? env.OPENCLAW_TEST_WORKERS,
|
||||
);
|
||||
if (workerBudget !== null && workerBudget <= 1) {
|
||||
if (hasConservativeVitestWorkerBudget(env)) {
|
||||
return 1;
|
||||
}
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user