chore(cloudflare): migrate to @cloudflare/vitest-plugin - #1259
Open
sentry-junior[bot] wants to merge 3 commits into
Open
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
Replace the deprecated vitest-pool-workers package with the new Vitest plugin and move Cloudflare worker tests onto @msw/cloudflare. Extract shared MSW handlers so Workers tests can reuse them without msw/node. Co-Authored-By: David Cramer <david@sentry.io>
dcramer
marked this pull request as ready for review
August 22, 2026 06:36
The Vitest plugin can use its own newer Wrangler dependency. Keep the app CLI pinned to 4.80 because 4.125 crashes during the local smoke workflow.
Keep the app CLI on Wrangler 4.80 until 4.125 stops aborting mid-smoke. Document the pin and tighten smoke readiness checks so upgrades fail loudly instead of flaking on OAuth metadata routes. Co-Authored-By: David Cramer <david@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates Cloudflare worker tests off the renamed
@cloudflare/vitest-pool-workerspackage to@cloudflare/vitest-pluginv1, and keeps the local Wrangler CLI pin safe for smoke.Why
Cloudflare published
@cloudflare/vitest-pluginas the replacement for@cloudflare/vitest-pool-workers. The new stack also recommends@msw/cloudflarefor outbound request mocks.App-level
wrangler@4.125.0still breaks local smoke for this Worker: early routes work, then the process dies around/.well-known/oauth-authorization-serverwith an empty ERROR (ECONNRESET→ECONNREFUSED). The Vitest plugin can keep its newer internal Wrangler; the app CLI stays on4.80.0until a newer release keeps smoke green.What changed
@cloudflare/vitest-plugin@1.0.0, add@msw/cloudflare, update MSW handlersfetchMockwith@msw/cloudflarenetwork mocks inmcp-cloudflarewrangler@4.80.0Verification
pnpm --filter @sentry/mcp-cloudflare test→ 32 files / 419 tests passedpnpm --filter @sentry/mcp-cloudflare tsc→ cleanwrangler@4.80.0green after pinwrangler@4.125.0mid-smoke abort; left pin in placeRefs: https://developers.cloudflare.com/changelog/post/2026-08-19-vitest-plugin/
Docs:
docs/cloudflare/wrangler-pin.mdRequested by David Cramer.
--
View Junior Session [Sentry]