Skip to content

test(test-utils): Extract Cloudflare Worker deploys into test-utils/cloudflare - #24815

Merged
JPeer264 merged 2 commits into
developfrom
jp/test-utils-cloudflare-helpers
Sep 29, 2026
Merged

JPeer264 merged 2 commits into
developfrom
jp/test-utils-cloudflare-helpers

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

All files are moved 1:1 to the @sentry-internal/test-utils/cloudflare helper, so we can reuse it in the future for other tests as well

The global setup and teardown that deploy and delete a real Worker for cloudflare-workers-send-to-sentry move to a new @sentry-internal/test-utils/cloudflare entrypoint, so the next send-to-sentry app can use the same steps. Each app keeps a global setup and teardown of one statement.

The helper now uploads the DSN and any other values with wrangler deploy --secrets-file instead of plain-text --var. Then wrangler does not print them in the deploy log, and API keys (for example the OpenRouter key of the Flue app) are not kept as plain-text vars on the Worker. The Worker code reads the DSN from env as before.

🤖 Generated with Claude Code

Comment thread dev-packages/test-utils/src/cloudflare.ts Dismissed
@JPeer264
JPeer264 added this pull request to stack #24817 September 29, 2026 08:43
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.18 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 31.02 kB - -
CDN Bundle (incl. Tracing) 51.78 kB - -
CDN Bundle (incl. Logs, Metrics) 33.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74 kB - -
CDN Bundle (incl. Tracing, Replay) 89.37 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.5 kB - -
CDN Bundle - uncompressed 91.66 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.05 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.8 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.78 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.72 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.41 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.6 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 141.92 kB +0.01% +12 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.88 kB - -
@sentry/node - without tracing 90.94 kB +0.02% +14 B 🔺
@sentry/node - without channel injection 120.3 kB +0.01% +8 B 🔺
@sentry/aws-serverless 99.17 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) - minified 206.64 kB - -
@sentry/cloudflare (withSentry) 514.04 kB - -

View base workflow run

@JPeer264
JPeer264 marked this pull request as ready for review September 29, 2026 09:32
JPeer264 and others added 2 commits September 29, 2026 15:51
…cloudflare`

The global setup and teardown that deploy and delete a real Worker lived in
cloudflare-workers-send-to-sentry. The next send-to-sentry app needs the same
steps, so they move to a shared `@sentry-internal/test-utils/cloudflare`
entrypoint, and each app keeps a global setup and teardown of one statement.

The DSN and other values now go up with `wrangler deploy --secrets-file`
instead of plain-text `--var`, so wrangler does not print them and API keys
are not kept as plain text on the Worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-utils/cloudflare`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/test-utils-cloudflare-helpers branch from c87adbf to 8263bf2 Compare September 29, 2026 13:51
@JPeer264
JPeer264 merged commit 6085cbc into develop Sep 29, 2026
655 of 658 checks passed
@JPeer264
JPeer264 deleted the jp/test-utils-cloudflare-helpers branch September 29, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants