diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 098f48c191a5..6c8b33708cc8 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -9,7 +9,12 @@ outputs: runs: using: 'composite' steps: + - name: Install dependencies from Namespace volume + if: env.CI_BENCHMARK_PROVIDER == 'namespace' + uses: ./.github/actions/install-namespace-dependencies + - name: Install pnpm + if: env.CI_BENCHMARK_PROVIDER != 'namespace' uses: ./.github/actions/install-pnpm - name: Compute dependency cache key @@ -20,11 +25,19 @@ runs: - name: Check dependency cache uses: actions/cache@v6.1.0 id: cache_dependencies + if: env.CI_BENCHMARK_PROVIDER != 'namespace' with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ steps.compute_lockfile_hash.outputs.hash }}-${{ runner.arch }} + key: ${{ env.CI_BENCHMARK_CACHE_PREFIX }}${{ steps.compute_lockfile_hash.outputs.hash }}-${{ runner.arch }} - name: Install dependencies - if: steps.cache_dependencies.outputs.cache-hit != 'true' + if: env.CI_BENCHMARK_PROVIDER != 'namespace' && steps.cache_dependencies.outputs.cache-hit != 'true' run: pnpm install --frozen-lockfile shell: bash + + - name: Report benchmark dependency cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' && env.CI_BENCHMARK_PROVIDER != 'namespace' + run: + echo "BENCHMARK_CACHE provider=github kind=workspace-node-modules hit=${{ + steps.cache_dependencies.outputs.cache-hit }}" + shell: bash diff --git a/.github/actions/install-namespace-dependencies/action.yml b/.github/actions/install-namespace-dependencies/action.yml new file mode 100644 index 000000000000..fafe4de3b022 --- /dev/null +++ b/.github/actions/install-namespace-dependencies/action.yml @@ -0,0 +1,64 @@ +name: 'Install pnpm dependencies' +description: 'Installs pnpm dependencies into node_modules folders on the Namespace cache volume.' + +runs: + using: 'composite' + steps: + - name: List dependency paths + id: paths + run: | + { + echo 'paths<> "$GITHUB_OUTPUT" + shell: bash + + - name: Mount dependency cache + uses: ./.github/actions/mount-pnpm-store + with: + path: ${{ steps.paths.outputs.paths }} + + - name: Install pnpm + uses: ./.github/actions/install-pnpm + + # When the node_modules layout changes, `pnpm install` keeps the `.bin` scripts of the workspace packages, which + # then point into a folder that the new layout does not have. Branches that change `nodeLinker` share this cache + # volume, so start from empty node_modules folders when the layout on the volume differs, or when an earlier + # install already left such broken `.bin` scripts behind. + - name: Remove node_modules of another layout + run: | + mapfile -t dirs < <(grep '/node_modules$' <<< "$DEPENDENCY_PATHS") + expected=$(pnpm config get node-linker) + if [[ "$expected" == undefined ]]; then + expected=isolated + fi + actual=$(sed -n 's/^nodeLinker: //p' node_modules/.modules.yaml 2>/dev/null || true) + if [[ -n "$actual" && "$actual" != "$expected" ]]; then + reason="The node_modules folders use the $actual layout, but nodeLinker is $expected." + else + broken=$(node "$GITHUB_ACTION_PATH/find-broken-bin.mjs" "${dirs[@]}") + if [[ -n "$broken" ]]; then + reason="The target of $broken does not exist." + fi + fi + if [[ -n "$reason" ]]; then + echo "$reason Removing the node_modules folders." + for dir in "${dirs[@]}"; do + if [[ -d "$dir" ]]; then + # The folders are mounted from the cache volume, so empty them instead of removing them + find "$dir/" -mindepth 1 -maxdepth 1 -exec rm -rf {} + + fi + done + fi + env: + DEPENDENCY_PATHS: ${{ steps.paths.outputs.paths }} + shell: bash + + # The cache volume can hold node_modules of another commit or branch. This is a no-op when they match + # pnpm-lock.yaml. + - name: Install dependencies + run: pnpm install --frozen-lockfile + shell: bash diff --git a/.github/actions/install-namespace-dependencies/find-broken-bin.mjs b/.github/actions/install-namespace-dependencies/find-broken-bin.mjs new file mode 100644 index 000000000000..24aa8753cac5 --- /dev/null +++ b/.github/actions/install-namespace-dependencies/find-broken-bin.mjs @@ -0,0 +1,34 @@ +// Prints the first `.bin` entry in the given node_modules folders whose target does not exist. +import { existsSync, lstatSync, readdirSync, readFileSync } from 'node:fs'; +import { join, resolve } from 'node:path'; + +// The pnpm shell shim runs the target with `exec "$basedir_abs/"` (`$basedir` in older versions) +const SHIM_TARGET = /^\s*exec \S+\s+"\$basedir(?:_abs)?\/([^"]+)"/m; + +for (const dir of process.argv.slice(2)) { + const binDir = join(dir, '.bin'); + let names; + try { + names = readdirSync(binDir); + } catch { + continue; + } + + for (const name of names) { + const bin = join(binDir, name); + const stat = lstatSync(bin); + let target; + if (stat.isSymbolicLink()) { + target = bin; + } else if (stat.isFile() && stat.size < 64 * 1024) { + const match = readFileSync(bin, 'utf8').match(SHIM_TARGET); + target = match && resolve(binDir, match[1]); + } + + if (target && !existsSync(target)) { + // eslint-disable-next-line no-console + console.log(bin); + process.exit(0); + } + } +} diff --git a/.github/actions/install-playwright/action.yml b/.github/actions/install-playwright/action.yml index b642f77815d3..99ad246080d1 100644 --- a/.github/actions/install-playwright/action.yml +++ b/.github/actions/install-playwright/action.yml @@ -26,15 +26,32 @@ runs: shell: bash working-directory: ${{ inputs.cwd }} + - name: Mount Playwright browser cache + id: playwright-volume + if: steps.playwright-version.outputs.version != '' && env.CI_BENCHMARK_PROVIDER == 'namespace' + uses: namespacelabs/nscloud-cache-action@1124a6f3ce44e5cf84cc22111530961f4d2a15f9 # v1.7.0 + with: + path: ~/.cache/ms-playwright + - name: Restore cached playwright binaries uses: actions/cache/restore@v6.1.0 id: playwright-cache - if: steps.playwright-version.outputs.version != '' + if: steps.playwright-version.outputs.version != '' && env.CI_BENCHMARK_PROVIDER != 'namespace' with: path: | ~/.cache/ms-playwright # Bump the iteration when bumping runner images to use a new cache - key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }} + key: + ${{ env.CI_BENCHMARK_CACHE_PREFIX }}playwright-${{ runner.os }}-${{ runner.arch }}-iteration-1-${{ + steps.playwright-version.outputs.version }} + + - name: Report benchmark browser cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' && steps.playwright-version.outputs.version != '' + run: + echo "BENCHMARK_CACHE provider=${{ env.CI_BENCHMARK_PROVIDER }} kind=playwright hit=${{ + env.CI_BENCHMARK_PROVIDER == 'namespace' && steps.playwright-volume.outputs.cache-hit || + steps.playwright-cache.outputs.cache-hit }}" + shell: bash # We always install all browsers, if uncached # `npx` runs outside the repo, so it can't pick up a `playwright` that a parallel `pnpm install` is still linking. @@ -66,6 +83,7 @@ runs: libopus0 libwayland-server0 ) + packages+=(libgtk-4-1 libgraphene-1.0-0 libsecret-1-0 libx264-164) # Resolve now and install after restoring the cache; share the package list across both steps. printf '%s\n' "${packages[@]}" > "$RUNNER_TEMP/webkit-apt-packages" # runner.temp is private, so keep installers where apt's sandbox user can access them. @@ -83,14 +101,21 @@ runs: # Separate Ubuntu versions and architectures, while allowing older package sets as fallbacks. . /etc/os-release - prefix="webkit-apt-$ID-$VERSION_ID-${{ runner.arch }}-v1-" + prefix="${CI_BENCHMARK_CACHE_PREFIX:-}webkit-apt-$ID-$VERSION_ID-${{ runner.arch }}-v1-" echo "prefix=$prefix" >> "$GITHUB_OUTPUT" echo "key=$prefix$hash" >> "$GITHUB_OUTPUT" shell: bash + - name: Mount WebKit package archives + id: webkit-volume + if: steps.webkit-dependencies.outputs.key != '' && env.CI_BENCHMARK_PROVIDER == 'namespace' + uses: namespacelabs/nscloud-cache-action@1124a6f3ce44e5cf84cc22111530961f4d2a15f9 # v1.7.0 + with: + path: /var/tmp/webkit-apt-cache + - name: Restore cached WebKit system packages id: webkit-apt-cache - if: steps.webkit-dependencies.outputs.key != '' + if: steps.webkit-dependencies.outputs.key != '' && env.CI_BENCHMARK_PROVIDER != 'namespace' uses: actions/cache/restore@v6.1.0 with: path: /var/tmp/webkit-apt-cache/*.deb @@ -98,6 +123,14 @@ runs: # If this exact package set isn't cached, reuse an older set; apt downloads only what's missing. restore-keys: ${{ steps.webkit-dependencies.outputs.prefix }} + - name: Report benchmark WebKit cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' && steps.webkit-dependencies.outputs.key != '' + run: + echo "BENCHMARK_CACHE provider=${{ env.CI_BENCHMARK_PROVIDER }} kind=webkit-apt hit=${{ + env.CI_BENCHMARK_PROVIDER == 'namespace' && steps.webkit-volume.outputs.cache-hit || + steps.webkit-apt-cache.outputs.cache-hit }}" + shell: bash + - name: Install headless WebKit system dependencies if: steps.webkit-dependencies.outputs.key != '' run: | @@ -111,8 +144,9 @@ runs: - name: Remove obsolete cached WebKit packages if: - steps.webkit-dependencies.outputs.key != '' && steps.webkit-apt-cache.outputs.cache-hit != 'true' && - github.event_name == 'push' && github.ref == 'refs/heads/develop' + steps.webkit-dependencies.outputs.key != '' && steps.webkit-apt-cache.outputs.cache-hit != 'true' && (github.ref + == 'refs/heads/develop' || (env.CI_BENCHMARK_CACHE_PREFIX != '' && (github.head_ref == 'feat/namespace-ci-smoke' + || github.ref == 'refs/heads/feat/namespace-ci-smoke'))) # Fallback restores can carry obsolete installers into newer cache entries. run: sudo apt-get -o Dir::Cache::archives=/var/tmp/webkit-apt-cache autoclean shell: bash @@ -121,21 +155,26 @@ runs: # which may have downloaded packages absent from the restored cache. - name: Store cached WebKit system packages if: - steps.webkit-dependencies.outputs.key != '' && steps.webkit-apt-cache.outputs.cache-hit != 'true' && - github.event_name == 'push' && github.ref == 'refs/heads/develop' + env.CI_BENCHMARK_PROVIDER != 'namespace' && steps.webkit-dependencies.outputs.key != '' && + steps.webkit-apt-cache.outputs.cache-hit != 'true' && (github.ref == 'refs/heads/develop' || + (env.CI_BENCHMARK_CACHE_PREFIX != '' && (github.head_ref == 'feat/namespace-ci-smoke' || github.ref == + 'refs/heads/feat/namespace-ci-smoke'))) uses: actions/cache/save@v6.1.0 with: path: /var/tmp/webkit-apt-cache/*.deb key: ${{ steps.webkit-dependencies.outputs.key }} - # Only store cache on develop branch + # The benchmark branch also saves isolated entries so warm runs can be verified. - name: Store cached playwright binaries uses: actions/cache/save@v6.1.0 if: - steps.playwright-version.outputs.version != '' && github.event_name == 'push' && github.ref == - 'refs/heads/develop' + steps.playwright-version.outputs.version != '' && env.CI_BENCHMARK_PROVIDER != 'namespace' && (github.ref == + 'refs/heads/develop' || (env.CI_BENCHMARK_CACHE_PREFIX != '' && (github.head_ref == 'feat/namespace-ci-smoke' || + github.ref == 'refs/heads/feat/namespace-ci-smoke'))) with: path: | ~/.cache/ms-playwright # Bump the iteration when bumping runner images to use a new cache - key: playwright-${{ runner.os }}-iteration-1-${{ steps.playwright-version.outputs.version }} + key: + ${{ env.CI_BENCHMARK_CACHE_PREFIX }}playwright-${{ runner.os }}-${{ runner.arch }}-iteration-1-${{ + steps.playwright-version.outputs.version }} diff --git a/.github/actions/mount-pnpm-store/action.yml b/.github/actions/mount-pnpm-store/action.yml new file mode 100644 index 000000000000..2a24b515c668 --- /dev/null +++ b/.github/actions/mount-pnpm-store/action.yml @@ -0,0 +1,43 @@ +name: 'Mount pnpm store' +description: + 'Mounts the pnpm store, the pnpm and npm caches and the given paths from the Namespace cache volume. Use it before + `install-pnpm`, so `install-pnpm` takes pnpm from the cache volume.' + +inputs: + path: + description: 'Paths to mount from the cache volume in addition to the pnpm store and caches, one per line.' + required: false + default: '' + +runs: + using: 'composite' + steps: + # Replaces the `pnpm` mode of nscloud-cache-action until it works without pnpm on PATH. The mode runs `pnpm store + # path`, so it only works after `install-pnpm`, when `pnpm self-update` has already downloaded pnpm. + # The cache directory holds `lockfile-verified.jsonl`. With it, `pnpm install` skips the supply-chain check of a + # lockfile that was already verified, which otherwise fetches the metadata of every package from the registry. + - name: Set pnpm store and cache directories + run: | + echo "PNPM_CONFIG_STORE_DIR=$HOME/.cache/pnpm-store" >> "$GITHUB_ENV" + echo "PNPM_CONFIG_CACHE_DIR=$HOME/.cache/pnpm" >> "$GITHUB_ENV" + shell: bash + + # The `npm` mode keeps the npm cache of the `npm ci` in `pnpm/action-setup`, which installs the bootstrap pnpm + - name: Mount cache paths + id: volume + uses: namespacelabs/nscloud-cache-action@1124a6f3ce44e5cf84cc22111530961f4d2a15f9 # v1.7.0 + with: + cache: npm + path: | + ~/.cache/pnpm-store + ~/.cache/pnpm + ${{ inputs.path }} + + - name: Report benchmark package cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' + run: | + echo "BENCHMARK_CACHE provider=namespace kind=package-store hit=${{ steps.volume.outputs.cache-hit }}" + if test -f "$GITHUB_WORKSPACE/node_modules/.modules.yaml"; then + echo 'BENCHMARK_CACHE provider=namespace kind=workspace-node-modules present=true' + fi + shell: bash diff --git a/.github/actions/prepare-e2e-test/action.yml b/.github/actions/prepare-e2e-test/action.yml index d81386521507..d15f79a7a05d 100644 --- a/.github/actions/prepare-e2e-test/action.yml +++ b/.github/actions/prepare-e2e-test/action.yml @@ -47,6 +47,10 @@ runs: uses: denoland/setup-deno@v2.0.5 with: deno-version: ${{ inputs.deno-version || 'v2.8.3' }} + - name: Mount E2E package stores + if: env.CI_BENCHMARK_PROVIDER == 'namespace' + uses: ./.github/actions/mount-pnpm-store + - name: Install pnpm uses: ./.github/actions/install-pnpm diff --git a/.github/actions/restore-cache/action.yml b/.github/actions/restore-cache/action.yml index 4112ad39ee54..ff9f90c5a07d 100644 --- a/.github/actions/restore-cache/action.yml +++ b/.github/actions/restore-cache/action.yml @@ -10,14 +10,16 @@ runs: using: 'composite' steps: - name: Install pnpm + if: env.CI_BENCHMARK_PROVIDER != 'namespace' uses: ./.github/actions/install-pnpm - name: Check dependency cache id: dep-cache + if: env.CI_BENCHMARK_PROVIDER != 'namespace' uses: actions/cache/restore@v6.1.0 with: path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ inputs.dependency_cache_key }}-${{ runner.arch }} + key: ${{ env.CI_BENCHMARK_CACHE_PREFIX }}${{ inputs.dependency_cache_key }}-${{ runner.arch }} - name: Restore build artifacts uses: actions/download-artifact@v7 @@ -25,6 +27,16 @@ runs: name: build-output - name: Install dependencies - if: steps.dep-cache.outputs.cache-hit != 'true' + if: env.CI_BENCHMARK_PROVIDER != 'namespace' && steps.dep-cache.outputs.cache-hit != 'true' run: pnpm install --frozen-lockfile shell: bash + + - name: Install dependencies from Namespace volume + if: env.CI_BENCHMARK_PROVIDER == 'namespace' + uses: ./.github/actions/install-namespace-dependencies + + - name: Report benchmark dependency cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' && env.CI_BENCHMARK_PROVIDER != 'namespace' + run: + echo "BENCHMARK_CACHE provider=github kind=workspace-node-modules hit=${{ steps.dep-cache.outputs.cache-hit }}" + shell: bash diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 77a4f3eb8db3..53e6e104957f 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -23,10 +23,20 @@ runs: with: node-version: ${{ steps.node.outputs.version }} - # Only `develop` saves, so PRs share one entry per architecture instead of each creating their own. + # The benchmark branch also saves isolated entries so warm runs can be verified. - name: Save Node.js install - if: steps.node-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/develop' + if: + steps.node-cache.outputs.cache-hit != 'true' && (github.ref == 'refs/heads/develop' || + (env.CI_BENCHMARK_CACHE_PREFIX != '' && (github.head_ref == 'feat/namespace-ci-smoke' || github.ref == + 'refs/heads/feat/namespace-ci-smoke'))) uses: actions/cache/save@v6.1.0 with: path: ${{ steps.node.outputs.cache-path }} key: ${{ steps.node.outputs.cache-key }} + + - name: Report benchmark Node cache + if: env.CI_BENCHMARK_CACHE_PREFIX != '' + run: + echo "BENCHMARK_CACHE provider=${{ env.CI_BENCHMARK_PROVIDER }} kind=node-toolcache hit=${{ + steps.node-cache.outputs.cache-hit }}" + shell: bash diff --git a/.github/actions/setup-node/resolve-node.sh b/.github/actions/setup-node/resolve-node.sh index a611890c4023..c76375047aea 100755 --- a/.github/actions/setup-node/resolve-node.sh +++ b/.github/actions/setup-node/resolve-node.sh @@ -3,6 +3,6 @@ set -eu version=$(jq -e -r '.devEngines.runtime.version' package.json) cache_path="$RUNNER_TOOL_CACHE/node/$version" -cache_key="node-toolcache-$RUNNER_OS-$RUNNER_ARCH-$version" +cache_key="${CI_BENCHMARK_CACHE_PREFIX:-}node-toolcache-$RUNNER_OS-$RUNNER_ARCH-$version" printf 'version=%s\ncache-path=%s\ncache-key=%s\n' "$version" "$cache_path" "$cache_key" >> "$GITHUB_OUTPUT" diff --git a/.github/namespace-benchmark-e2e-runners.json b/.github/namespace-benchmark-e2e-runners.json new file mode 100644 index 000000000000..e2595fde004f --- /dev/null +++ b/.github/namespace-benchmark-e2e-runners.json @@ -0,0 +1,23 @@ +{ + "aws-serverless-layer": "namespace-profile-sentry-javascript", + "browser-bfcache": "namespace-profile-sentry-javascript", + "nextjs-15-basepath": "namespace-profile-sentry-javascript", + "nextjs-15-intl": "namespace-profile-sentry-javascript", + "nextjs-15-t3": "namespace-profile-sentry-javascript", + "nextjs-15": "namespace-profile-sentry-javascript", + "nextjs-16-adapter": "namespace-profile-sentry-javascript", + "nextjs-16-cacheComponents": "namespace-profile-sentry-javascript", + "nextjs-16-static": "namespace-profile-sentry-javascript", + "nextjs-16-streaming-cacheComponents": "namespace-profile-sentry-javascript", + "nextjs-16-streaming": "namespace-profile-sentry-javascript", + "nextjs-16-tunnel": "namespace-profile-sentry-javascript", + "nextjs-16": "namespace-profile-sentry-javascript", + "nextjs-app-dir": "namespace-profile-sentry-javascript", + "nextjs-pages-dir": "namespace-profile-sentry-javascript", + "nuxt-3-min": "namespace-profile-sentry-javascript", + "nuxt-4-static": "namespace-profile-sentry-javascript", + "nuxt-4": "namespace-profile-sentry-javascript", + "react-router-6": "namespace-profile-sentry-javascript", + "react-router-7-lazy-routes": "namespace-profile-sentry-javascript", + "react-router-8-framework": "namespace-profile-sentry-javascript" +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66d006e800c7..5dbdf6478b1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,5 @@ name: 'CI: Build & Test' +run-name: 'CI benchmark: github-warm-3' on: push: branches: @@ -27,7 +28,9 @@ concurrency: cancel-in-progress: true env: - HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }} + CI_BENCHMARK_PROVIDER: github + CI_BENCHMARK_CACHE_PREFIX: bench-sentry-js-20261112-github-c- + HEAD_COMMIT: ${{ github.event.inputs.commit || github.event.pull_request.head.sha || github.sha }} CACHED_DEPENDENCY_PATHS: | ${{ github.workspace }}/node_modules @@ -51,21 +54,20 @@ env: BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages - NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }} + NX_CACHE_KEY: bench-sentry-js-20261112-github-c-nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }} # https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h # Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.". # This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages. DISABLE_V8_COMPILE_CACHE: '1' -# Jobs that need the monorepo dependencies restore them from the GitHub Actions cache (see `restore-cache`), -# keyed by the lockfile hash. E2E jobs install their test application separately and do not use that cache. +# Benchmark volumes separate monorepo dependencies, E2E stores and latest-Wrangler dependencies. jobs: job_get_metadata: uses: ./.github/workflows/ci-metadata.yml name: Get CI Metadata with: - head_commit: ${{ github.event.inputs.commit || github.sha }} + head_commit: ${{ github.event.inputs.commit || github.event.pull_request.head.sha || github.sha }} permissions: pull-requests: read @@ -478,11 +480,11 @@ jobs: - name: Run affected tests run: pnpm run test:pr:browser --base=${{ github.event.pull_request.base.sha }} - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && env.CI_BENCHMARK_CACHE_PREFIX == '' - name: Run all tests run: pnpm run test:ci:browser - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || env.CI_BENCHMARK_CACHE_PREFIX != '' job_bun_unit_tests: name: Bun (${{ matrix.bun }}) Unit Tests @@ -578,13 +580,13 @@ jobs: - name: Run affected tests run: pnpm run test:pr:node --base=${{ github.event.pull_request.base.sha }} - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && env.CI_BENCHMARK_CACHE_PREFIX == '' env: NODE_VERSION: ${{ matrix.node }} - name: Run all tests run: pnpm run test:ci:node - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || env.CI_BENCHMARK_CACHE_PREFIX != '' env: NODE_VERSION: ${{ matrix.node }} @@ -888,6 +890,8 @@ jobs: steps: *cloudflare_integration_tests_steps job_bundler_plugin_integration_tests: + env: + SENTRY_RELEASE: ${{ github.event.inputs.commit || github.event.pull_request.head.sha || github.sha }} name: Bundler Plugin Integration Tests (Node ${{ matrix.node }}) needs: [job_get_metadata, job_build] if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request' diff --git a/.github/workflows/optional-e2e.yml b/.github/workflows/optional-e2e.yml index eea799a5a5f9..e5a8dc53afd2 100644 --- a/.github/workflows/optional-e2e.yml +++ b/.github/workflows/optional-e2e.yml @@ -29,6 +29,8 @@ concurrency: cancel-in-progress: true env: + CI_BENCHMARK_PROVIDER: github + CI_BENCHMARK_CACHE_PREFIX: bench-sentry-js-20261112-github-c- HEAD_COMMIT: ${{ inputs.commit }} # See build.yml diff --git a/dev-packages/e2e-tests/lib/getTestMatrix.mjs b/dev-packages/e2e-tests/lib/getTestMatrix.mjs index 0f52cd017a2e..b46073ab0552 100644 --- a/dev-packages/e2e-tests/lib/getTestMatrix.mjs +++ b/dev-packages/e2e-tests/lib/getTestMatrix.mjs @@ -115,7 +115,13 @@ function addIncludesForTestApp(testApp, includes, { variant }) { const shouldSkip = packageJson.sentryTest?.skip || false; const isOptional = packageJson.sentryTest?.optional || false; const variants = packageJson.sentryTest?.[VARIANT_FIELDS[variant]] || []; - const baseInclude = { 'test-application': testApp }; + const runner = + process.env.CI_BENCHMARK_PROVIDER === 'namespace' + ? JSON.parse( + fs.readFileSync(path.join(__dirname, '../../../.github/namespace-benchmark-e2e-runners.json'), 'utf8'), + )[testApp] + : undefined; + const baseInclude = { 'test-application': testApp, ...(runner ? { runner } : {}) }; if (shouldSkip) { return;