From 6cb3c52b4ccd9ce3021203bce7a885bc5b49684b Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 17 Nov 2026 12:11:07 +0100 Subject: [PATCH 1/4] test(ci): Record Node unit-test sharding baseline Co-Authored-By: OpenAI Codex --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a29c36743adb..02d2c2cfe251 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,5 @@ name: 'CI: Build & Test' +# Full-CI baseline for the Node unit-test sharding benchmark. # Full-CI baseline for the Nuxt production/development split benchmark. on: push: @@ -579,12 +580,23 @@ jobs: if: github.event_name == 'pull_request' env: NODE_VERSION: ${{ matrix.node }} + NX_OUTPUT_STYLE: static - name: Run all tests run: pnpm run test:ci:node if: github.event_name != 'pull_request' env: NODE_VERSION: ${{ matrix.node }} + NX_OUTPUT_STYLE: static + + - name: Upload unit-test results for benchmark verification + if: always() + uses: actions/upload-artifact@v7 + with: + name: node-unit-results-${{ matrix.node }} + path: packages/*/vitest.junit.xml + if-no-files-found: error + retention-days: 4 job_browser_playwright_tests: name: From e9ccb80e565e3ec6b73e59dcaf17e3cd70564e61 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 17 Nov 2026 12:15:07 +0100 Subject: [PATCH 2/4] test(ci): Trigger all unit-test packages for baseline Co-Authored-By: OpenAI Codex --- .size-limit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.size-limit.js b/.size-limit.js index b841667d9d89..f8ac7f5f82b8 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -1,3 +1,4 @@ +// Trigger the full unit-test baseline for the sharding benchmark. const builtinModules = require('module').builtinModules; const nodePrefixedBuiltinModules = builtinModules.map(m => `node:${m}`); From 4925d801f3976a3069e76ff068bcf7e88ae2709b Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 17 Nov 2026 12:16:02 +0100 Subject: [PATCH 3/4] perf(ci): Split Node unit tests across two jobs Co-Authored-By: OpenAI Codex --- .github/workflows/build.yml | 7 +++++-- scripts/ci-unit-tests.ts | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02d2c2cfe251..8cca88b8bf8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -541,7 +541,7 @@ jobs: pnpm run test job_node_unit_tests: - name: Node (${{ matrix.node }}) Unit Tests + name: Node (${{ matrix.node }}) Unit Tests (${{ matrix.shard }}/2) needs: [job_get_metadata, job_build] timeout-minutes: 10 runs-on: ubuntu-24.04-arm @@ -551,6 +551,7 @@ jobs: fail-fast: false matrix: node: [20.19, 22, 24, 26, '^27.0.0-0'] + shard: [1, 2] steps: - name: Check out base commit (${{ github.event.pull_request.base.sha }}) uses: actions/checkout@v7 @@ -580,6 +581,7 @@ jobs: if: github.event_name == 'pull_request' env: NODE_VERSION: ${{ matrix.node }} + UNIT_TEST_SHARD: ${{ matrix.shard }} NX_OUTPUT_STYLE: static - name: Run all tests @@ -587,13 +589,14 @@ jobs: if: github.event_name != 'pull_request' env: NODE_VERSION: ${{ matrix.node }} + UNIT_TEST_SHARD: ${{ matrix.shard }} NX_OUTPUT_STYLE: static - name: Upload unit-test results for benchmark verification if: always() uses: actions/upload-artifact@v7 with: - name: node-unit-results-${{ matrix.node }} + name: node-unit-results-${{ matrix.node }}-${{ matrix.shard }} path: packages/*/vitest.junit.xml if-no-files-found: error retention-days: 4 diff --git a/scripts/ci-unit-tests.ts b/scripts/ci-unit-tests.ts index f2df019dda33..c8475fe2b506 100644 --- a/scripts/ci-unit-tests.ts +++ b/scripts/ci-unit-tests.ts @@ -4,6 +4,7 @@ import * as path from 'path'; const UNIT_TEST_ENV = process.env.UNIT_TEST_ENV as 'node' | 'browser' | undefined; const RUN_AFFECTED = process.argv.includes('--affected'); +const UNIT_TEST_SHARD = process.env.UNIT_TEST_SHARD; // These packages are tested separately in CI, so no need to run them here const DEFAULT_SKIP_PACKAGES = ['@sentry/bun', '@sentry/deno']; @@ -58,6 +59,21 @@ function runTests(): void { BROWSER_TEST_PACKAGES.forEach(pkg => ignores.add(pkg)); } + if (UNIT_TEST_SHARD) { + if (UNIT_TEST_SHARD !== '1' && UNIT_TEST_SHARD !== '2') { + throw new Error(`Invalid unit-test shard: ${UNIT_TEST_SHARD}`); + } + + packages + .filter(pkg => !ignores.has(pkg)) + .sort() + .forEach((pkg, index) => { + if (index % 2 !== Number(UNIT_TEST_SHARD) - 1) { + ignores.add(pkg); + } + }); + } + if (RUN_AFFECTED) { runAffectedTests(ignores); } else { From 9198b7a9b309e550b44f5e46d08c23a24a2ff95c Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 17 Nov 2026 13:25:54 +0100 Subject: [PATCH 4/4] chore(ci): Remove unit-sharding benchmark scaffolding Co-Authored-By: OpenAI Codex --- .github/workflows/build.yml | 12 ------------ .size-limit.js | 1 - 2 files changed, 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cca88b8bf8f..119349c497b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,4 @@ name: 'CI: Build & Test' -# Full-CI baseline for the Node unit-test sharding benchmark. # Full-CI baseline for the Nuxt production/development split benchmark. on: push: @@ -582,7 +581,6 @@ jobs: env: NODE_VERSION: ${{ matrix.node }} UNIT_TEST_SHARD: ${{ matrix.shard }} - NX_OUTPUT_STYLE: static - name: Run all tests run: pnpm run test:ci:node @@ -590,16 +588,6 @@ jobs: env: NODE_VERSION: ${{ matrix.node }} UNIT_TEST_SHARD: ${{ matrix.shard }} - NX_OUTPUT_STYLE: static - - - name: Upload unit-test results for benchmark verification - if: always() - uses: actions/upload-artifact@v7 - with: - name: node-unit-results-${{ matrix.node }}-${{ matrix.shard }} - path: packages/*/vitest.junit.xml - if-no-files-found: error - retention-days: 4 job_browser_playwright_tests: name: diff --git a/.size-limit.js b/.size-limit.js index f8ac7f5f82b8..b841667d9d89 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -1,4 +1,3 @@ -// Trigger the full unit-test baseline for the sharding benchmark. const builtinModules = require('module').builtinModules; const nodePrefixedBuiltinModules = builtinModules.map(m => `node:${m}`);