Skip to content

Commit 2f41466

Browse files
committed
ci: add NO_CONCURRENT support for testing on Windows and resource-constrained systems
1 parent 75077d7 commit 2f41466

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

jest.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ module.exports = {
99
testEnvironment: 'node',
1010
testRunner: 'jest-circus/runner',
1111
// ? 24h if debugging so MMS and other tools don't choke, otherwise 1m
12-
testTimeout: 1000 * 60 * (process.env.VSCODE_INSPECTOR_OPTIONS ? 60 * 24 : 1),
12+
testTimeout:
13+
1000 *
14+
60 *
15+
(process.env.VSCODE_INSPECTOR_OPTIONS
16+
? 60 * 24
17+
: process.platform == 'win32'
18+
? 5
19+
: 1),
1320
// ? Minimum of 10 concurrent tests executed at once; maximum of cpu cores - 1
1421
maxConcurrency: Math.max(require('node:os').cpus().length - 1, 10),
1522
verbose: false,

test/integration/integration-node-interop.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ for (const esm of [true, false] as const) {
6262
debug(`registered test: ${title}`);
6363

6464
// eslint-disable-next-line jest/valid-title
65-
it.concurrent(title, async () => {
65+
(process.env.NO_CONCURRENT ? it : it.concurrent)(title, async () => {
66+
// eslint-disable-next-line jest/no-standalone-expect
6667
expect.hasAssertions();
6768

6869
debug(`started running test: ${title}`);

test/integration/integration-node-smoke.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ for (const [babelPkg, ...otherBabelPkgs] of BABEL_VERSIONS_UNDER_TEST) {
6262
debug(`registered test: ${title}`);
6363

6464
// eslint-disable-next-line jest/valid-title
65-
it.concurrent(title, async () => {
65+
(process.env.NO_CONCURRENT ? it : it.concurrent)(title, async () => {
66+
// eslint-disable-next-line jest/no-standalone-expect
6667
expect.hasAssertions();
6768

6869
debug(`started running test: ${title}`);

0 commit comments

Comments
 (0)