Default test-electron worker count to 1 locally

This commit is contained in:
trevor-signal 2024-10-29 12:19:16 -04:00 committed by GitHub
parent c0050890a9
commit 58831f62c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,9 +17,17 @@ import { parseUnknown } from '../util/schemas';
const ROOT_DIR = join(__dirname, '..', '..'); const ROOT_DIR = join(__dirname, '..', '..');
const WORKER_COUNT = process.env.WORKER_COUNT function getWorkerCount(): number {
? parseInt(process.env.WORKER_COUNT, 10) if (process.env.WORKER_COUNT) {
: Math.min(8, cpus().length); return parseInt(process.env.WORKER_COUNT, 10);
}
if (process.env.CI) {
return Math.min(8, cpus().length);
}
return 1;
}
const WORKER_COUNT = getWorkerCount();
const ELECTRON = join( const ELECTRON = join(
ROOT_DIR, ROOT_DIR,