/
githubmirror
/
DefinitelyTyped
Обзор
Документация
Войти
/
githubmirror
/
DefinitelyTyped
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
scripts/get-ci-matrix.js
29 строк
639 B
Jake Bailey
🤖 Merge PR #72081 Shard out to 16 jobs on runs of all tests by @jakebailey
03 мар 2025, 21:18
Не верифицирован
03 мар 2025, 21:18
f554446
Код
Авторство
О чём код?
const arg = process.argv[2]; const maxAllJobs = 16; const maxJobs = 12; let shardCount; if (arg === "all") { shardCount = maxAllJobs; } else { const testCount = Number.parseInt(arg); const testsPerJob = 100; // Attempt to spawn as many jobs as needed to have at least `testsPerJob` tests per job. shardCount = Math.ceil(testCount / testsPerJob); shardCount = Math.min(shardCount, maxJobs); shardCount = Math.max(shardCount, 1); } const include = []; for (let i = 0; i < shardCount; i++) { include.push({ shardId: i + 1, shardCount, }); } console.log(JSON.stringify({ include }));