Skip to content

Commit 83f5f2d

Browse files
JPeer264claude
andcommitted
ci(cloudflare): Run the integration tests on the latest wrangler too
The required Cloudflare integration test job keeps the wrangler and `@cloudflare/vite-plugin` versions of the package. A new optional job runs the same steps with the latest versions of both, so a new wrangler or workerd release shows up in CI early but cannot block a PR. Like the optional E2E tests, it does not run on release branches. The two jobs share their steps through a YAML anchor. The runner starts `wrangler dev` on 127.0.0.1, because with the latest wrangler `localhost` connects over IPv6 and changes the captured client address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 58cd4f4 commit 83f5f2d

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ jobs:
854854
working-directory: dev-packages/node-integration-tests
855855
run: pnpm run test --shard=${{ matrix.shard }}/3
856856

857+
# Runs on the wrangler pinned in the package, so the required run stays on a fixed, older runtime.
857858
job_cloudflare_integration_tests:
858859
name: Cloudflare Integration Tests (${{ matrix.shard }}/2)
859860
needs: [job_get_metadata, job_build]
@@ -864,7 +865,7 @@ jobs:
864865
fail-fast: false
865866
matrix:
866867
shard: [1, 2]
867-
steps:
868+
steps: &cloudflare_integration_tests_steps
868869
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
869870
uses: actions/checkout@v7
870871
with:
@@ -878,10 +879,37 @@ jobs:
878879
with:
879880
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
880881

882+
# The Vite plugin depends on wrangler and writes config for it, so both move together. In the hoisted layout,
883+
# pnpm keeps the nested `node_modules` folders of the old versions (for example an old workerd under
884+
# `node_modules/wrangler`), so the install starts from empty `node_modules` folders.
885+
- name: Install the latest wrangler
886+
if: matrix.wrangler == 'latest'
887+
run: |
888+
pnpm --filter @sentry-internal/cloudflare-integration-tests add --save-dev --lockfile-only wrangler@latest @cloudflare/vite-plugin@latest
889+
rm -rf node_modules packages/*/node_modules dev-packages/*/node_modules
890+
pnpm install --frozen-lockfile --filter @sentry-internal/cloudflare-integration-tests...
891+
881892
- name: Run integration tests
882893
working-directory: dev-packages/cloudflare-integration-tests
883894
run: pnpm run test --shard=${{ matrix.shard }}/2
884895

896+
# Shows breakage from new wrangler and workerd releases early. It is not in `job_required_jobs_passed`, so it cannot
897+
# block a PR, and like the optional E2E tests it does not run on release branches.
898+
job_optional_cloudflare_integration_tests:
899+
name: Cloudflare Integration Tests (${{ matrix.shard }}/2, latest wrangler) (optional)
900+
needs: [job_get_metadata, job_build]
901+
if:
902+
needs.job_get_metadata.outputs.is_release != 'true' && (needs.job_build.outputs.changed_cloudflare_integration ==
903+
'true' || github.event_name != 'pull_request')
904+
runs-on: ubuntu-24.04
905+
timeout-minutes: 15
906+
strategy:
907+
fail-fast: false
908+
matrix:
909+
shard: [1, 2]
910+
wrangler: [latest]
911+
steps: *cloudflare_integration_tests_steps
912+
885913
job_bundler_plugin_integration_tests:
886914
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
887915
needs: [job_get_metadata, job_build]

‎dev-packages/cloudflare-integration-tests/runner.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ export function createRunner(...paths: string[]) {
489489
'false',
490490
'--var',
491491
`SENTRY_DSN:http://public@localhost:${mockServerPort}/1337`,
492+
'--ip',
493+
'127.0.0.1',
492494
'--port',
493495
'0',
494496
'--inspector-port',
@@ -521,6 +523,10 @@ export function createRunner(...paths: string[]) {
521523
`SENTRY_DSN:http://public@localhost:${mockServerPort}/1337`,
522524
'--var',
523525
`SERVER_URL:${serverUrl}`,
526+
// Requests go to `localhost`, which can resolve to `::1`. The IPv4 listener keeps the
527+
// client address at `127.0.0.1`, which the event expectations check.
528+
'--ip',
529+
'127.0.0.1',
524530
'--port',
525531
'0',
526532
'--inspector-port',

0 commit comments

Comments
 (0)