fix: use pnpm exec for scripted vitest runs

This commit is contained in:
Shakker
2026-04-02 11:15:15 +01:00
committed by Peter Steinberger
parent e1143fb95f
commit 9c4ea016d9
4 changed files with 59 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ run_linux_ci_mirror() {
run_step pnpm lint:ui:no-raw-window-open
run_protocol_ci_mirror
run_step pnpm canvas:a2ui:bundle
run_step pnpm vitest run --config vitest.extensions.config.ts --maxWorkers=1
run_step pnpm exec vitest run --config vitest.extensions.config.ts --maxWorkers=1
run_step env CI=true pnpm exec vitest run --config vitest.unit.config.ts --maxWorkers=1
log_step "OPENCLAW_VITEST_MAX_WORKERS=${OPENCLAW_VITEST_MAX_WORKERS:-1} NODE_OPTIONS=${NODE_OPTIONS:---max-old-space-size=6144} pnpm test"

View File

@@ -28,7 +28,7 @@ function runTests() {
const isolatedLock =
process.env.OPENCLAW_GATEWAY_LOCK ??
path.join(os.tmpdir(), `openclaw-gateway.lock.test.${Date.now()}`);
const result = spawnSync("pnpm", ["vitest", "run"], {
const result = spawnSync("pnpm", ["exec", "vitest", "run"], {
stdio: "inherit",
env: {
...process.env,

View File

@@ -43,7 +43,16 @@ export function runVitestJsonReport({
if (!(reportPath && fs.existsSync(resolvedReportPath))) {
const run = spawnSync(
"pnpm",
["vitest", "run", "--config", config, "--reporter=json", "--outputFile", resolvedReportPath],
[
"exec",
"vitest",
"run",
"--config",
config,
"--reporter=json",
"--outputFile",
resolvedReportPath,
],
{
stdio: "inherit",
env: process.env,