Skip to content

Commit

Permalink
[ci] Remove jest maxWorkers arg when running in github action
Browse files Browse the repository at this point in the history
Changes the `ci` argument to be an enum instead so the tests use all
available workers in GitHub actions

ghstack-source-id: 6ba49ccc0fbb42f4b0528231a055fdc282017898
Pull Request resolved: #30033
  • Loading branch information
poteto committed Jun 21, 2024
1 parent 84e9f7b commit f0cb46d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ jobs:
steps:
- checkout
- setup_node_modules
- run: yarn test <<parameters.args>> --ci
- run: yarn test <<parameters.args>> --ci=circleci

yarn_test_build:
docker: *docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn test ${{ matrix.params }} --ci
- run: yarn test ${{ matrix.params }} --ci=github
5 changes: 3 additions & 2 deletions scripts/jest/jest-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const argv = yargs
ci: {
describe: 'Run tests in CI',
requiresArg: false,
type: 'boolean',
type: 'choices',
choices: ['circleci', 'github'],
default: false,
},
compactConsole: {
Expand Down Expand Up @@ -309,7 +310,7 @@ function getCommandArgs() {
}

// CI Environments have limited workers.
if (argv.ci) {
if (argv.ci === 'circleci') {
args.push('--maxWorkers=2');
}

Expand Down

0 comments on commit f0cb46d

Please sign in to comment.