From dab9105d8a2faf5264ab1d21e576b0129f295b46 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 11:05:33 +0200 Subject: [PATCH 1/6] ci: Streamline CI browser playwright tests --- .github/actions/install-playwright/action.yml | 7 ++++++- .github/workflows/build.yml | 16 ++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/actions/install-playwright/action.yml b/.github/actions/install-playwright/action.yml index 29ecbcfbd2d1..7f85f5e743ba 100644 --- a/.github/actions/install-playwright/action.yml +++ b/.github/actions/install-playwright/action.yml @@ -1,5 +1,9 @@ name: "Install Playwright dependencies" description: "Installs Playwright dependencies and caches them." +inputs: + browsers: + description: 'What browsers to install.' + default: 'chromium webkit firefox' runs: using: "composite" @@ -17,12 +21,13 @@ runs: ~/.cache/ms-playwright key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + # We always install all browsers, if uncached - name: Install Playwright dependencies (uncached) run: npx playwright install chromium webkit firefox --with-deps if: steps.playwright-cache.outputs.cache-hit != 'true' shell: bash - name: Install Playwright system dependencies only (cached) - run: npx playwright install-deps chromium webkit firefox + run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }} if: steps.playwright-cache.outputs.cache-hit == 'true' shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5e9be1422e2..ad96cc01f6b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -548,7 +548,7 @@ jobs: project: - chromium include: - # Only check all projects for esm & full bundle + # Only check all projects for full bundle # We also shard the tests as they take the longest - bundle: bundle_tracing_replay_feedback_min project: '' @@ -559,16 +559,17 @@ jobs: shard: 2 shards: 2 - bundle: esm - project: '' shard: 1 - shards: 3 + shards: 4 - bundle: esm shard: 2 - shards: 3 + shards: 4 - bundle: esm - project: '' shard: 3 - shards: 3 + shards: 4 + - bundle: esm + shard: 4 + shards: 4 exclude: # Do not run the default chromium-only tests - bundle: bundle_tracing_replay_feedback_min @@ -592,12 +593,15 @@ jobs: - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: ${{ matrix.project }} - name: Run Playwright tests env: PW_BUNDLE: ${{ matrix.bundle }} working-directory: dev-packages/browser-integration-tests run: yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }} + - name: Upload Playwright Traces uses: actions/upload-artifact@v3 if: always() From a515af6c22c897ca65d5d3c516e3ac9264ceed71 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 11:56:44 +0200 Subject: [PATCH 2/6] esm in chromium only --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad96cc01f6b6..3aa939fa8fa5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -559,15 +559,19 @@ jobs: shard: 2 shards: 2 - bundle: esm + project: chromium shard: 1 shards: 4 - bundle: esm + project: chromium shard: 2 shards: 4 - bundle: esm + project: chromium shard: 3 shards: 4 - bundle: esm + project: chromium shard: 4 shards: 4 exclude: From 0606f638011f3e063f61c24162c27be74ff87c7c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 12:19:49 +0200 Subject: [PATCH 3/6] split by project --- .github/workflows/build.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3aa939fa8fa5..0dae80e02202 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -528,7 +528,7 @@ jobs: run: yarn lerna run test --scope @sentry/profiling-node job_browser_playwright_tests: - name: Playwright (${{ matrix.bundle }}${{ matrix.shard && format(' {0}/{1}', matrix.shard, matrix.shards) || ''}}) Tests + name: Playwright (${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' {0}/{1}', matrix.shard, matrix.shards) || ''}}) Tests needs: [job_get_metadata, job_build] if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request' runs-on: ubuntu-20.04-large-js @@ -551,13 +551,9 @@ jobs: # Only check all projects for full bundle # We also shard the tests as they take the longest - bundle: bundle_tracing_replay_feedback_min - project: '' - shard: 1 - shards: 2 + project: 'webkit' - bundle: bundle_tracing_replay_feedback_min - project: '' - shard: 2 - shards: 2 + project: 'firefox' - bundle: esm project: chromium shard: 1 @@ -575,9 +571,7 @@ jobs: shard: 4 shards: 4 exclude: - # Do not run the default chromium-only tests - - bundle: bundle_tracing_replay_feedback_min - project: 'chromium' + # Do not run the un-sharded esm tests - bundle: esm project: 'chromium' From 93e96a21f48882a17d425e2980c6dcd528914f55 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 12:59:51 +0200 Subject: [PATCH 4/6] better naming --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0dae80e02202..a6ecfb430a5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -528,7 +528,7 @@ jobs: run: yarn lerna run test --scope @sentry/profiling-node job_browser_playwright_tests: - name: Playwright (${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' {0}/{1}', matrix.shard, matrix.shards) || ''}}) Tests + name: PW ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests needs: [job_get_metadata, job_build] if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request' runs-on: ubuntu-20.04-large-js @@ -608,7 +608,7 @@ jobs: path: dev-packages/browser-integration-tests/test-results job_browser_loader_tests: - name: Playwright Loader (${{ matrix.bundle }}) Tests + name: PW ${{ matrix.bundle }} Tests needs: [job_get_metadata, job_build] if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request' runs-on: ubuntu-20.04 From c96397b0128e8b4f7151409ad10383332f86367c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 13:48:07 +0200 Subject: [PATCH 5/6] only install chromium in most places --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6ecfb430a5e..acaf3fefd183 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -641,6 +641,8 @@ jobs: - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: chromium - name: Run Playwright Loader tests env: @@ -752,8 +754,12 @@ jobs: uses: ./.github/actions/restore-cache env: DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }} + - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: chromium + - name: Run integration tests env: NODE_VERSION: ${{ matrix.node }} @@ -955,6 +961,8 @@ jobs: - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: chromium - name: Get node version id: versions @@ -1052,6 +1060,8 @@ jobs: - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: chromium - name: Get node version id: versions @@ -1152,6 +1162,8 @@ jobs: - name: Install Playwright uses: ./.github/actions/install-playwright + with: + browsers: chromium - name: Get node version id: versions From eccc3356cf56bffd9c5bdcef085941bc3584344a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 8 Aug 2024 15:42:12 +0200 Subject: [PATCH 6/6] rename to playwright --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acaf3fefd183..8ab03a313253 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -528,7 +528,7 @@ jobs: run: yarn lerna run test --scope @sentry/profiling-node job_browser_playwright_tests: - name: PW ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests + name: Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests needs: [job_get_metadata, job_build] if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request' runs-on: ubuntu-20.04-large-js