-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shard testing, do more on GitHub Actions (#68386)
- Loading branch information
1 parent
124c5f3
commit 6d0e970
Showing
5 changed files
with
129 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const testCount = Number.parseInt(process.argv[2]); | ||
|
||
const testsPerJob = 250; | ||
const maxJobs = 8; | ||
|
||
// Attempt to spawn as many jobs as needed to have only 250 tests per job, | ||
// up to 8 concurrent jobs. | ||
let 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 })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { suggestionsDir } from "@definitelytyped/utils"; | ||
|
||
console.log(suggestionsDir); |