Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/e2e/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ All tests completed successfully. Your SDK changes work correctly with this test
- **Test app not found**: List available apps and ask user to clarify
- **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests`
- **Build failures**: Fix build errors before running tests
- **pnpm errors such as `packages field missing or empty`**: The app needs the pnpm version in its `volta.pnpm`. Run with Volta, which installs that version

## Common Test Applications

Expand Down
30 changes: 30 additions & 0 deletions .github/actions/install-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Install pnpm'
description: 'Installs the pnpm version that Volta pins for a package.'
inputs:
package-json:
description: 'The package.json to read `volta.pnpm` from. `volta.extends` is followed until a version is found.'
default: 'package.json'

runs:
using: 'composite'
steps:
- name: Resolve pnpm version
id: pnpm-version
shell: bash
env:
PACKAGE_JSON: ${{ inputs.package-json }}
# Keep in sync with `getPnpmMajor` in `dev-packages/e2e-tests/lib/pnpmOverrides.ts`. It writes the overrides in
# the format of the version it finds, so a different lookup breaks the install.
run: |
package_json="$PACKAGE_JSON"
until version=$(jq -er '.volta.pnpm' "$package_json"); do
extends=$(jq -er '.volta.extends' "$package_json") || {
echo "::error::No volta.pnpm in $PACKAGE_JSON or the files it extends"
exit 1
}
package_json="$(dirname "$package_json")/$extends"
done
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: ${{ steps.pnpm-version.outputs.version }}
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,8 @@ jobs:
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 9.15.9
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down Expand Up @@ -1056,9 +1055,10 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
version: ${{ matrix.test-application == 'nuxt-5' && '11.10.0' || '9.15.9' }}
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down Expand Up @@ -1211,9 +1211,10 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
version: ${{ matrix.test-application == 'nuxt-5' && '11.10.0' || '9.15.9' }}
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
version: 9.15.9
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
VITE_E2E_TEST_DSN: 'https://username@domain/123'
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 9.15.9
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- uses: actions/setup-node@v7
with:
node-version-file: 'package.json'
Expand Down
3 changes: 3 additions & 0 deletions dev-packages/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ Make sure to add a `test:build` and `test:assert` command to the new app's `pack
Sentry packages are automatically resolved to the local build via pnpm overrides injected at test time, so no manual
registry configuration is needed.

Apps use the root pnpm version. To use another one, set `volta.pnpm` in the app's `package.json`. Volta (locally) and
CI (`.github/actions/install-pnpm`) both install that version.

### Test apps that deploy a real Cloudflare Worker

Apps like `cloudflare-workers-send-to-sentry` deploy the built app as a real Worker and check what arrives in Sentry:
Expand Down
1 change: 1 addition & 0 deletions dev-packages/e2e-tests/lib/pnpmOverrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export async function addPnpmOverrides(tmpDirPath: string, packedDirPath: string
console.log(`Added ${packageNames.length} internal Sentry package overrides`);
}

// Keep in sync with `.github/actions/install-pnpm`, which installs the version this finds in CI.
async function getPnpmMajor(
packageJsonPath: string,
packageJson: { volta?: { extends?: string; pnpm?: string } },
Expand Down
Loading