Skip to content

test(cloudflare): Add integration test infrastructure #16848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Jul 8, 2025

I tried using cloudflare:test and the wrangler vitest pool but with the config it doesn't appear like there's an easy way to have more than one wrangler config. This isn't very useful if you want to add lots of different tests with different wrangler configurations!

After much frustration and attempts I decided to just copy the Node integration test runner and strip out all the stuff we didn't need. This took less time than I'd already spend messing around. I debated making the test runners use shared code but quickly discounted that because of how little actually ends up being shared.

This PR:

  • Moves createBasicSentryServer from the Node integration test to @sentry-internal/test-utils so it can be used by both
  • Added dev-packages/cloudflare-integration-tests/ with all the basic files it needs
  • Create a simplified test runner that runs wrangler in dev mode
    • spawn('wrangler', ['dev', '--config', wranglerConfigPath, '--var', 'SENTRY_DSN:${SENTRY_DSN}']);
  • Adds a simple test for throwing in the fetch handler which asserts the entire envelope
  • Adds the new test project to CI

@AbhiPrasad AbhiPrasad requested review from a team, mydea, msonnb and AbhiPrasad and removed request for a team July 8, 2025 18:37
cursor[bot]

This comment was marked as off-topic.

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.

2 participants