Skip to content

Commit 4de6b07

Browse files
committed
[ci] Improve parallelism of yarn test
Changes the `ci` argument to be an enum instead so the tests use all available workers in GitHub actions. - When `ci === 'github'` also increase maxConcurrency to 10 - Increase timeout of ReactMultiChildText-test.js ghstack-source-id: f8dee9a Pull Request resolved: #30033
1 parent 650763a commit 4de6b07

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ jobs:
368368
steps:
369369
- checkout
370370
- setup_node_modules
371-
- run: yarn test <<parameters.args>> --ci
371+
- run: yarn test <<parameters.args>> --ci=circleci
372372

373373
yarn_test_build:
374374
docker: *docker

.github/workflows/runtime_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ jobs:
5252
path: "**/node_modules"
5353
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
5454
- run: yarn install --frozen-lockfile
55-
- run: yarn test ${{ matrix.params }} --ci
55+
- run: yarn test ${{ matrix.params }} --ci=github

packages/react-dom/src/__tests__/ReactMultiChildText-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const expectChildren = function (container, children) {
7777
* faster to render and update.
7878
*/
7979
describe('ReactMultiChildText', () => {
80-
jest.setTimeout(20000);
80+
jest.setTimeout(30000);
8181

8282
it('should correctly handle all possible children for render and update', async () => {
8383
await expect(async () => {

scripts/jest/jest-cli.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ const argv = yargs
9191
ci: {
9292
describe: 'Run tests in CI',
9393
requiresArg: false,
94-
type: 'boolean',
95-
default: false,
94+
type: 'choices',
95+
choices: ['circleci', 'github'],
9696
},
9797
compactConsole: {
9898
alias: 'c',
@@ -309,10 +309,14 @@ function getCommandArgs() {
309309
}
310310

311311
// CI Environments have limited workers.
312-
if (argv.ci) {
312+
if (argv.ci === 'circleci') {
313313
args.push('--maxWorkers=2');
314314
}
315315

316+
if (argv.ci === 'github') {
317+
args.push('--maxConcurrency=10 --workerThreads=true');
318+
}
319+
316320
// Push the remaining args onto the command.
317321
// This will send args like `--watch` to Jest.
318322
args.push(...argv._);

0 commit comments

Comments
 (0)