mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-05 22:32:12 +00:00
fix: throttle vitest under local contention
This commit is contained in:
26
scripts/run-vitest.mjs
Normal file
26
scripts/run-vitest.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
import { spawnPnpmRunner } from "./pnpm-runner.mjs";
|
||||
|
||||
const forwardedArgs = process.argv.slice(2);
|
||||
|
||||
if (forwardedArgs.length === 0) {
|
||||
console.error("usage: node scripts/run-vitest.mjs <vitest args...>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const child = spawnPnpmRunner({
|
||||
pnpmArgs: ["exec", "vitest", ...forwardedArgs],
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
child.on("exit", (code, signal) => {
|
||||
if (signal) {
|
||||
process.kill(process.pid, signal);
|
||||
return;
|
||||
}
|
||||
process.exit(code ?? 1);
|
||||
});
|
||||
|
||||
child.on("error", (error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user