Skip to content

[wrangler] fix: update remote proxy session error test snapshots#13935

Merged
petebacondarwin merged 1 commit into
mainfrom
fix/remote-proxy-session-error-test-snapshots
May 15, 2026
Merged

[wrangler] fix: update remote proxy session error test snapshots#13935
petebacondarwin merged 1 commit into
mainfrom
fix/remote-proxy-session-error-test-snapshots

Conversation

@petebacondarwin

Copy link
Copy Markdown
Contributor

Fixes the test regression introduced by #11896, which enriched the error thrown by startRemoteProxySession but pointed two real-API tests at a regex (Failed to create a preview token) that does not match the message that actually surfaces in CI:

Failed to start the remote proxy session. Error reloading remote server: A request to the Cloudflare API (/accounts/<id>/workers/subdomain/edge-preview) failed.

This PR updates the two tests that exercise real API calls so their assertions reflect the actual error string:

  • fixtures/get-platform-proxy-remote-bindings/tests/index.test.ts — back to toMatchInlineSnapshot (the invalid account id is a hard-coded literal here, so no normalization needed).
  • packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts — capture via try/catch and assert against normalizeOutput(...) so the real CLOUDFLARE_ACCOUNT_ID is normalized in the snapshot.

The mocked unit test in packages/wrangler/src/__tests__/dev/remote-bindings-errors.test.ts and the loosely-asserting packages/vite-plugin-cloudflare/e2e/remote-bindings.test.ts are unaffected and were left alone.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: test-only change; no user-facing behaviour change.

A picture of a cute animal (not mandatory, but encouraged)

PR #11896 enriched the error thrown by startRemoteProxySession but
updated test expectations to a 'Failed to create a preview token'
regex that does not match the actual surfaced message
('Error reloading remote server: A request to the Cloudflare API
... failed.'), regressing two real-API tests.

- fixtures/get-platform-proxy-remote-bindings: switch back to
  toMatchInlineSnapshot with the current literal message.
- packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:
  capture via try/catch and assert against normalizeOutput so the
  real account id is normalized in the snapshot.
@petebacondarwin petebacondarwin added the ci:no-changeset-required Skip pull request checks for a valid changeset label May 15, 2026
@changeset-bot

changeset-bot Bot commented May 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 426e2e2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk May 15, 2026
@workers-devprod workers-devprod requested review from a team and jamesopstad and removed request for a team May 15, 2026 16:22
@workers-devprod

workers-devprod commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@petebacondarwin petebacondarwin added the ci:run-remote-tests Run remote/E2E tests that require Cloudflare API credentials label May 15, 2026
ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Review posted successfully on PR #13935. The main feedback is about the try/catch pattern in the e2e tests — if the function under test stops throwing, error remains undefined and the test fails with a confusing snapshot mismatch rather than a clear "expected to throw" message. I suggested an alternative using .catch((e) => e) combined with expect(error).toBeInstanceOf(Error) to make the intent explicit while still allowing normalizeOutput on the error message.

github run

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 15, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 15, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13935

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13935

miniflare

npm i https://pkg.pr.new/miniflare@13935

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13935

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13935

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13935

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13935

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13935

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13935

wrangler

npm i https://pkg.pr.new/wrangler@13935

commit: 426e2e2

devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin merged commit 1d8924f into main May 15, 2026
85 of 106 checks passed
@petebacondarwin petebacondarwin deleted the fix/remote-proxy-session-error-test-snapshots branch May 15, 2026 16:39
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:no-changeset-required Skip pull request checks for a valid changeset ci:run-remote-tests Run remote/E2E tests that require Cloudflare API credentials

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants