From cd701c2c5b3630d3bad0e44f05395e4010c37064 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 13:30:31 -0400 Subject: [PATCH 01/22] Update [ghstack-poisoned] --- .circleci/config.yml | 2 +- .github/workflows/runtime_test.yml | 2 +- scripts/jest/jest-cli.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 894e52fab609d..d50f491ab5085 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -368,7 +368,7 @@ jobs: steps: - checkout - setup_node_modules - - run: yarn test <> --ci + - run: yarn test <> --ci=circleci yarn_test_build: docker: *docker diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 1acce045217ee..ce797cb4439ff 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -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 diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 9c3be220fb645..63ec492bacd8b 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -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: { @@ -309,7 +310,7 @@ function getCommandArgs() { } // CI Environments have limited workers. - if (argv.ci) { + if (argv.ci === 'circleci') { args.push('--maxWorkers=2'); } From 3f77a5b9443087d548e0e892dbcebe3396a870e0 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 13:32:45 -0400 Subject: [PATCH 02/22] Update [ghstack-poisoned] --- scripts/jest/jest-cli.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 63ec492bacd8b..092aa6fa930eb 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -93,7 +93,6 @@ const argv = yargs requiresArg: false, type: 'choices', choices: ['circleci', 'github'], - default: false, }, compactConsole: { alias: 'c', From 0e5fb2720c4d78f65032e543e1d67287fc3fc4dc Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 13:40:19 -0400 Subject: [PATCH 03/22] Update [ghstack-poisoned] --- scripts/jest/jest-cli.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 092aa6fa930eb..edb506cd535aa 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -313,6 +313,10 @@ function getCommandArgs() { args.push('--maxWorkers=2'); } + if (argv.ci === 'github') { + args.push('--maxConcurrency=10 --workerThreads=true'); + } + // Push the remaining args onto the command. // This will send args like `--watch` to Jest. args.push(...argv._); From d7e6317d31fdb4315d7a0e45c195b08bf07827b2 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 13:51:55 -0400 Subject: [PATCH 04/22] Update [ghstack-poisoned] --- packages/react-dom/src/__tests__/ReactMultiChildText-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom/src/__tests__/ReactMultiChildText-test.js b/packages/react-dom/src/__tests__/ReactMultiChildText-test.js index c32d13d3b0151..5aeb321308090 100644 --- a/packages/react-dom/src/__tests__/ReactMultiChildText-test.js +++ b/packages/react-dom/src/__tests__/ReactMultiChildText-test.js @@ -77,7 +77,7 @@ const expectChildren = function (container, children) { * faster to render and update. */ describe('ReactMultiChildText', () => { - jest.setTimeout(20000); + jest.setTimeout(30000); it('should correctly handle all possible children for render and update', async () => { await expect(async () => { From b580968696016b6c5161614dd1be6697891e7d6f Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:21:40 -0400 Subject: [PATCH 05/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 92 +++++++++++++++++++++--------- scripts/jest/jest-cli.js | 22 +++---- 2 files changed, 77 insertions(+), 37 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index ce797cb4439ff..ef7debb0f916a 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -8,36 +8,74 @@ on: - 'compiler/**' jobs: - test: - name: yarn test + build_test_params: + name: Build test params runs-on: ubuntu-latest + outputs: + params: ${{ steps.define-params.outputs.result }} + steps: + - uses: actions/github-script@v7 + id: define-params + with: + script: | + return [ + "-r=stable --env=development", + "-r=stable --env=production", + "-r=experimental --env=development", + "-r=experimental --env=production", + "-r=www-classic --env=development --variant=false", + "-r=www-classic --env=production --variant=false", + "-r=www-classic --env=development --variant=true", + "-r=www-classic --env=production --variant=true", + "-r=www-modern --env=development --variant=false", + "-r=www-modern --env=production --variant=false", + "-r=www-modern --env=development --variant=true", + "-r=www-modern --env=production --variant=true", + "-r=xplat --env=development --variant=false", + "-r=xplat --env=development --variant=true", + "-r=xplat --env=production --variant=false", + "-r=xplat --env=production --variant=true", + // TODO: Test more persistent configurations? + "-r=stable --env=development --persistent", + "-r=experimental --env=development --persistent" + ]; + + chunk_tests: + name: Chunk tests + runs-on: ubuntu-latest + needs: build_test_params + strategy: + matrix: + params: ${{ fromJSON(needs.build_test_params.outputs) }} continue-on-error: true + outputs: + test_names: ${{ steps.chunk-test-files.outputs }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + cache: "yarn" + cache-dependency-path: yarn.lock + - name: Restore cached node_modules + uses: actions/cache@v4 + id: node_modules + with: + path: "**/node_modules" + key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} + - run: yarn install --frozen-lockfile + - id: chunk-test-files + run: yarn --silent test ${{ matrix.params }} --listTests --json --silent | jq '[_nwise(length / 5 | ceil)]' >> $GITHUB_OUTPUT + + test: + name: yarn test ${{ needs.build_test_params.outputs.params }} + runs-on: ubuntu-latest + needs: [build_test_params, chunk_tests] strategy: matrix: - # Intentionally passing these as strings instead of creating a - # separate parameter per CLI argument, since it's easier to - # control/see which combinations we want to run. - params: [ - "-r=stable --env=development", - "-r=stable --env=production", - "-r=experimental --env=development", - "-r=experimental --env=production", - "-r=www-classic --env=development --variant=false", - "-r=www-classic --env=production --variant=false", - "-r=www-classic --env=development --variant=true", - "-r=www-classic --env=production --variant=true", - "-r=www-modern --env=development --variant=false", - "-r=www-modern --env=production --variant=false", - "-r=www-modern --env=development --variant=true", - "-r=www-modern --env=production --variant=true", - "-r=xplat --env=development --variant=false", - "-r=xplat --env=development --variant=true", - "-r=xplat --env=production --variant=false", - "-r=xplat --env=production --variant=true", - # TODO: Test more persistent configurations? - "-r=stable --env=development --persistent", - "-r=experimental --env=development --persistent" - ] + params: ${{ fromJSON(needs.build_test_params.outputs) }} + test_names: ${{ fromJSON(needs.chunk_tests.outputs ) }} + continue-on-error: true steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -52,4 +90,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=github + - run: yarn test ${{ matrix.params }} --ci=github ${{ matrix.test_names }} diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index edb506cd535aa..29c58e688a2a0 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -368,16 +368,18 @@ function main() { const envars = getEnvars(); const env = Object.entries(envars).map(([k, v]) => `${k}=${v}`); - // Print the full command we're actually running. - const command = `$ ${env.join(' ')} node ${args.join(' ')}`; - console.log(chalk.dim(command)); - - // Print the release channel and project we're running for quick confirmation. - console.log( - chalk.blue( - `\nRunning tests for ${argv.project} (${argv.releaseChannel})...` - ) - ); + if (argv.ci !== 'github') { + // Print the full command we're actually running. + const command = `$ ${env.join(' ')} node ${args.join(' ')}`; + console.log(chalk.dim(command)); + + // Print the release channel and project we're running for quick confirmation. + console.log( + chalk.blue( + `\nRunning tests for ${argv.project} (${argv.releaseChannel})...` + ) + ); + } // Print a message that the debugger is starting just // for some extra feedback when running the debugger. From 94d0e54e631060b07a145ee591827cc7ddbb1477 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:25:33 -0400 Subject: [PATCH 06/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index ef7debb0f916a..fe90b9de7b84e 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -46,7 +46,7 @@ jobs: needs: build_test_params strategy: matrix: - params: ${{ fromJSON(needs.build_test_params.outputs) }} + params: ${{ fromJSON(needs.build_test_params.outputs.params) }} continue-on-error: true outputs: test_names: ${{ steps.chunk-test-files.outputs }} @@ -73,8 +73,8 @@ jobs: needs: [build_test_params, chunk_tests] strategy: matrix: - params: ${{ fromJSON(needs.build_test_params.outputs) }} - test_names: ${{ fromJSON(needs.chunk_tests.outputs ) }} + params: ${{ fromJSON(needs.build_test_params.outputs.params) }} + test_names: ${{ fromJSON(needs.chunk_tests.outputs.test_names) }} continue-on-error: true steps: - uses: actions/checkout@v4 @@ -90,4 +90,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=github ${{ matrix.test_names }} + - run: echo $CHUNKS | jq '.[${{ matrix.test_names }}] | .[] | @text' | xargs yarn test ${{ matrix.params }} --ci=github From bb426b7e3e6ade6bc42c4be1e4931e6a946391b1 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:27:42 -0400 Subject: [PATCH 07/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index fe90b9de7b84e..79f89de42c155 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -65,7 +65,7 @@ jobs: key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - id: chunk-test-files - run: yarn --silent test ${{ matrix.params }} --listTests --json --silent | jq '[_nwise(length / 5 | ceil)]' >> $GITHUB_OUTPUT + run: yarn --silent test ${{ matrix.params }} --listTests --json --silent --ci=github | jq '[_nwise(length / 5 | ceil)]' >> $GITHUB_OUTPUT test: name: yarn test ${{ needs.build_test_params.outputs.params }} From 723951816c4f4eea8797f78b8dfa65c509834732 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:39:56 -0400 Subject: [PATCH 08/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 79f89de42c155..535168d227a6a 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -49,7 +49,8 @@ jobs: params: ${{ fromJSON(needs.build_test_params.outputs.params) }} continue-on-error: true outputs: - test_names: ${{ steps.chunk-test-files.outputs }} + chunks: ${{ steps.chunks.outputs }} + chunk_ids: ${{ steps.chunk_ids.outputs }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -64,17 +65,23 @@ jobs: path: "**/node_modules" key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - - id: chunk-test-files - run: yarn --silent test ${{ matrix.params }} --listTests --json --silent --ci=github | jq '[_nwise(length / 5 | ceil)]' >> $GITHUB_OUTPUT + - id: chunks + name: Set chunks + run: echo "chunks=$(yarn --silent test ${{ matrix.params }} --listTests --json --ci=github | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT + - id: chunk_ids + name: Set chunk IDs + run: echo "$chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT + env: + CHUNKS: ${{ steps.chunks.outputs }} test: - name: yarn test ${{ needs.build_test_params.outputs.params }} + name: yarn test ${{ matrix.params }} (${{ matrix.chunk_ids }}) runs-on: ubuntu-latest needs: [build_test_params, chunk_tests] strategy: matrix: params: ${{ fromJSON(needs.build_test_params.outputs.params) }} - test_names: ${{ fromJSON(needs.chunk_tests.outputs.test_names) }} + chunk_ids: ${{ fromJSON(needs.chunk_tests.outputs.chunk_ids) }} continue-on-error: true steps: - uses: actions/checkout@v4 @@ -90,4 +97,6 @@ jobs: path: "**/node_modules" key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - - run: echo $CHUNKS | jq '.[${{ matrix.test_names }}] | .[] | @text' | xargs yarn test ${{ matrix.params }} --ci=github + - run: echo $CHUNKS | jq '.[${{ matrix.chunk_ids }}] | .[] | @text' | xargs yarn test ${{ matrix.params }} --ci=github + env: + CHUNKS: ${{ needs.chunk_tests.outputs.chunks }} From c8074b891d098682eb1f94e161604da54e1b860c Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:42:03 -0400 Subject: [PATCH 09/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 535168d227a6a..0d0e9a48777d3 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -49,8 +49,8 @@ jobs: params: ${{ fromJSON(needs.build_test_params.outputs.params) }} continue-on-error: true outputs: - chunks: ${{ steps.chunks.outputs }} - chunk_ids: ${{ steps.chunk_ids.outputs }} + chunks: ${{ steps.chunks.outputs.chunks }} + chunk_ids: ${{ steps.chunk_ids.outputs.chunk_ids }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From c6276785dd8bdb9ceff9ded1fdee9104dcfe9679 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:43:26 -0400 Subject: [PATCH 10/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 0d0e9a48777d3..db5faf8c9ed78 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -72,7 +72,7 @@ jobs: name: Set chunk IDs run: echo "$chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT env: - CHUNKS: ${{ steps.chunks.outputs }} + CHUNKS: ${{ steps.chunks.outputs.chunks }} test: name: yarn test ${{ matrix.params }} (${{ matrix.chunk_ids }}) From ec4f520699ad233b6d4aa08ac21f23d0b7a688d0 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:45:09 -0400 Subject: [PATCH 11/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index db5faf8c9ed78..2d9e8b1958a31 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -70,7 +70,7 @@ jobs: run: echo "chunks=$(yarn --silent test ${{ matrix.params }} --listTests --json --ci=github | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT - id: chunk_ids name: Set chunk IDs - run: echo "$chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT + run: echo "chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT env: CHUNKS: ${{ steps.chunks.outputs.chunks }} From 56323c015a01be81c18ea47d8085c1064fbde221 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:51:13 -0400 Subject: [PATCH 12/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 2d9e8b1958a31..490540398ba0d 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -13,6 +13,8 @@ jobs: runs-on: ubuntu-latest outputs: params: ${{ steps.define-params.outputs.result }} + # How many chunks to group tests into + parallelism: 3 steps: - uses: actions/github-script@v7 id: define-params @@ -67,7 +69,7 @@ jobs: - run: yarn install --frozen-lockfile - id: chunks name: Set chunks - run: echo "chunks=$(yarn --silent test ${{ matrix.params }} --listTests --json --ci=github | jq -cM '[_nwise(length / 2 | ceil)]')" >> $GITHUB_OUTPUT + run: echo "chunks=$(yarn --silent test ${{ matrix.params }} --listTests --json --ci=github | jq -cM '[_nwise(length / ${{ needs.build_test_params.outputs.parallelism }} | ceil)]')" >> $GITHUB_OUTPUT - id: chunk_ids name: Set chunk IDs run: echo "chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT @@ -75,7 +77,7 @@ jobs: CHUNKS: ${{ steps.chunks.outputs.chunks }} test: - name: yarn test ${{ matrix.params }} (${{ matrix.chunk_ids }}) + name: yarn test ${{ matrix.params }} (Chunk ${{ matrix.chunk_ids }}) runs-on: ubuntu-latest needs: [build_test_params, chunk_tests] strategy: From 480c185a0df330a4f4bf6c81983be657c6f9b466 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 14:57:59 -0400 Subject: [PATCH 13/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 490540398ba0d..d41ac1e105259 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -8,13 +8,14 @@ on: - 'compiler/**' jobs: + # Define the various test parameters and parallelism for this workflow build_test_params: name: Build test params runs-on: ubuntu-latest outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 3 + parallelism: 4 steps: - uses: actions/github-script@v7 id: define-params @@ -42,6 +43,7 @@ jobs: "-r=experimental --env=development --persistent" ]; + # Chunk tests into groups for parallelism chunk_tests: name: Chunk tests runs-on: ubuntu-latest @@ -76,6 +78,7 @@ jobs: env: CHUNKS: ${{ steps.chunks.outputs.chunks }} + # Spawn a job for each set of test param and number of chunks test: name: yarn test ${{ matrix.params }} (Chunk ${{ matrix.chunk_ids }}) runs-on: ubuntu-latest From b6bb7b9ba75a4805d5bf6c06a0b3dbcfc3b530ce Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:02:33 -0400 Subject: [PATCH 14/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index d41ac1e105259..7ef699a9f2148 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -15,7 +15,7 @@ jobs: outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 4 + parallelism: 5 steps: - uses: actions/github-script@v7 id: define-params From ea5a382f8a08eca953e793445e7e97ccda7a1667 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:10:38 -0400 Subject: [PATCH 15/22] Update [ghstack-poisoned] --- .circleci/config.yml | 4 ++-- .github/workflows/fuzz_tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d50f491ab5085..7ce9c199d4c7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -281,7 +281,7 @@ jobs: at: . - setup_node_modules - run: ./scripts/circleci/download_devtools_regression_build.js << parameters.version >> --replaceBuild - - run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion << parameters.version >> --ci + - run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion << parameters.version >> --ci=circleci run_devtools_e2e_tests_for_versions: docker: *docker @@ -382,7 +382,7 @@ jobs: - attach_workspace: at: . - setup_node_modules - - run: yarn test --build <> --ci + - run: yarn test --build <> --ci=circleci RELEASE_CHANNEL_stable_yarn_test_dom_fixtures: docker: *docker diff --git a/.github/workflows/fuzz_tests.yml b/.github/workflows/fuzz_tests.yml index 492dd7dc4c81d..4c4373be373ea 100644 --- a/.github/workflows/fuzz_tests.yml +++ b/.github/workflows/fuzz_tests.yml @@ -28,5 +28,5 @@ jobs: shell: bash - name: Run fuzz tests run: |- - FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci - FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci + FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci=github + FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci=github From 6cefcf1f621eb4794cdd44a211a35451225254ce Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:12:06 -0400 Subject: [PATCH 16/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 7ef699a9f2148..92c38a3ce325c 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -15,7 +15,7 @@ jobs: outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 5 + parallelism: 10 steps: - uses: actions/github-script@v7 id: define-params From b08653b9a2d77a3449562e6ed08fc3d7ff89c2eb Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:19:06 -0400 Subject: [PATCH 17/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 92c38a3ce325c..7ef699a9f2148 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -15,7 +15,7 @@ jobs: outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 10 + parallelism: 5 steps: - uses: actions/github-script@v7 id: define-params From 4310c822736c517a69dbe52425ee91c1febbd1f2 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:22:31 -0400 Subject: [PATCH 18/22] Update [ghstack-poisoned] --- scripts/jest/jest-cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 29c58e688a2a0..70d4d04b2b456 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -314,7 +314,7 @@ function getCommandArgs() { } if (argv.ci === 'github') { - args.push('--maxConcurrency=10 --workerThreads=true'); + args.push('--maxConcurrency=10'); } // Push the remaining args onto the command. From 2b60259318003590c6ac6af8521e444a1675f7db Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:31:39 -0400 Subject: [PATCH 19/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 7ef699a9f2148..8801ee2d0df46 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -15,7 +15,7 @@ jobs: outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 5 + parallelism: 7 steps: - uses: actions/github-script@v7 id: define-params From 7b1b3b77d47990f118b2833ab041e1defc19c0ac Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 21 Jun 2024 15:45:28 -0400 Subject: [PATCH 20/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 8801ee2d0df46..814dc3d4b9811 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -15,7 +15,7 @@ jobs: outputs: params: ${{ steps.define-params.outputs.result }} # How many chunks to group tests into - parallelism: 7 + parallelism: 5 steps: - uses: actions/github-script@v7 id: define-params @@ -34,10 +34,11 @@ jobs: "-r=www-modern --env=production --variant=false", "-r=www-modern --env=development --variant=true", "-r=www-modern --env=production --variant=true", - "-r=xplat --env=development --variant=false", - "-r=xplat --env=development --variant=true", - "-r=xplat --env=production --variant=false", - "-r=xplat --env=production --variant=true", + // Chunks may include only react-dom tests which xplat doesn't run + "-r=xplat --env=development --variant=false --passWithNoTests", + "-r=xplat --env=development --variant=true --passWithNoTests", + "-r=xplat --env=production --variant=false --passWithNoTests", + "-r=xplat --env=production --variant=true --passWithNoTests", // TODO: Test more persistent configurations? "-r=stable --env=development --persistent", "-r=experimental --env=development --persistent" From 4b42b7558339461d9513443f6b71ade342c355af Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Sat, 22 Jun 2024 12:23:08 -0400 Subject: [PATCH 21/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 67 ++++++++++-------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 4dbfd275d4d57..56fdc4ba472ba 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -7,6 +7,10 @@ on: paths-ignore: - 'compiler/**' +env: + # Number of workers (one per shard) to spawn + SHARD_COUNT: 5 + jobs: # Define the various test parameters and parallelism for this workflow build_test_params: @@ -14,9 +18,20 @@ jobs: runs-on: ubuntu-latest outputs: params: ${{ steps.define-params.outputs.result }} - # How many chunks to group tests into - parallelism: 5 + shard_id: ${{ steps.define-chunks.outputs.result }} steps: + - uses: actions/github-script@v7 + id: define-chunks + with: + script: | + function range(from, to) { + const arr = []; + for (let n = from; n < to; n++) { + arr.push(n); + } + return arr; + } + return range(0, process.env.SHARD_COUNT); - uses: actions/github-script@v7 id: define-params with: @@ -43,51 +58,15 @@ jobs: "-r=experimental --env=development --persistent" ]; - # Chunk tests into groups for parallelism - chunk_tests: - name: Chunk tests - runs-on: ubuntu-latest - needs: build_test_params - strategy: - matrix: - params: ${{ fromJSON(needs.build_test_params.outputs.params) }} - continue-on-error: true - outputs: - chunks: ${{ steps.chunks.outputs.chunks }} - chunk_ids: ${{ steps.chunk_ids.outputs.chunk_ids }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18.x - cache: "yarn" - cache-dependency-path: yarn.lock - - name: Restore cached node_modules - uses: actions/cache@v4 - id: node_modules - with: - path: "**/node_modules" - key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - - run: yarn install --frozen-lockfile - - id: chunks - name: Set chunks - run: echo "chunks=$(yarn --silent test ${{ matrix.params }} --listTests --json --ci=github | jq -cM '[_nwise(length / ${{ needs.build_test_params.outputs.parallelism }} | ceil)]')" >> $GITHUB_OUTPUT - - id: chunk_ids - name: Set chunk IDs - run: echo "chunk_ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT - env: - CHUNKS: ${{ steps.chunks.outputs.chunks }} - - # Spawn a job for each set of test param and number of chunks + # Spawn a job for each shard for a given set of test params test: - name: yarn test ${{ matrix.params }} (Chunk ${{ matrix.chunk_ids }}) + name: yarn test ${{ matrix.params }} (Chunk ${{ matrix.shard_id }}) runs-on: ubuntu-latest - needs: [build_test_params, chunk_tests] + needs: build_test_params strategy: matrix: params: ${{ fromJSON(needs.build_test_params.outputs.params) }} - chunks: ${{ fromJSON(needs.chunk_tests.outputs.chunks) }} - chunk_ids: ${{ fromJSON(needs.chunk_tests.outputs.chunk_ids) }} + shard_id: ${{ fromJSON(needs.build_test_params.outputs.shard_id) }} continue-on-error: true steps: - uses: actions/checkout@v4 @@ -103,6 +82,4 @@ jobs: path: "**/node_modules" key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} - run: yarn install --frozen-lockfile - - run: echo $CHUNKS | jq '.[${{ matrix.chunk_ids }}] | .[] | @text' | xargs yarn test ${{ matrix.params }} --ci=github - env: - CHUNKS: ${{ matrix.chunks }} + - run: yarn test ${{ matrix.params }} --ci=github --shard=${{ matrix.shard_id }}/${{ env.SHARD_COUNT }} From e4b9888f02e2a0e065694c6fb21da7e7033c1b9f Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Sat, 22 Jun 2024 12:26:35 -0400 Subject: [PATCH 22/22] Update [ghstack-poisoned] --- .github/workflows/runtime_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/runtime_test.yml b/.github/workflows/runtime_test.yml index 56fdc4ba472ba..a9ec4dbc7acd1 100644 --- a/.github/workflows/runtime_test.yml +++ b/.github/workflows/runtime_test.yml @@ -18,20 +18,20 @@ jobs: runs-on: ubuntu-latest outputs: params: ${{ steps.define-params.outputs.result }} - shard_id: ${{ steps.define-chunks.outputs.result }} + shard_id: ${{ steps.define-shards.outputs.result }} steps: - uses: actions/github-script@v7 - id: define-chunks + id: define-shards with: script: | function range(from, to) { const arr = []; - for (let n = from; n < to; n++) { + for (let n = from; n <= to; n++) { arr.push(n); } return arr; } - return range(0, process.env.SHARD_COUNT); + return range(1, process.env.SHARD_COUNT); - uses: actions/github-script@v7 id: define-params with: @@ -60,7 +60,7 @@ jobs: # Spawn a job for each shard for a given set of test params test: - name: yarn test ${{ matrix.params }} (Chunk ${{ matrix.shard_id }}) + name: yarn test ${{ matrix.params }} (Shard ${{ matrix.shard_id }}) runs-on: ubuntu-latest needs: build_test_params strategy: