test(test-utils): Add Sentry CLI trace helpers as test-utils/cli - #24279
Draft
JPeer264 wants to merge 1 commit into
Draft
test(test-utils): Add Sentry CLI trace helpers as test-utils/cli#24279JPeer264 wants to merge 1 commit into
test-utils/cli#24279JPeer264 wants to merge 1 commit into
Conversation
Send-to-sentry E2E apps need to wait until their data is queryable in Sentry. The new subpath export polls through the `sentry` CLI instead of hand-rolled requests against the trace endpoint, and gives the tests a paste-able `sentry trace view` command for debugging. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JPeer264
added this pull request to stack #24281
September 10, 2026 06:29
Contributor
size-limit report 📦
|
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.
Adds
@sentry-internal/test-utils/cli, a helper module for E2E apps that send real data to Sentry and have to wait until it is queryable. It shells out to thesentryCLI (sentry trace view <org>/<project>/<trace> --json --fresh) instead of hand-rolling requests against the organization trace endpoint, and exposesfindErrorInTrace,findSpanInTrace,fetchTrace,flattenTrace,traceTargetandEVENT_POLLING_OPTIONS.Decisions:
sentrypackage on npm), not of test-utils. The helper runspnpm exec sentryin the app's working directory, which keeps the 15 MB CLI out of every other test app.E2E_TEST_AUTH_TOKENto the CLI asSENTRY_AUTH_TOKENand setsSENTRY_FORCE_ENV_TOKEN=1. Without the flag the CLI prefers a developer's stored login over the env token, so local runs would authenticate differently from CI.--freshbypasses the CLI's response cache, which would otherwise defeat polling.org:read.traceTargetreturns the CLI target, so a test can log asentry trace view ...line that is paste-able into a terminal when a CI run fails.The first consumer is the Cloudflare send-to-sentry E2E app in the follow-up PR.
react-send-to-sentryandnode-express-send-to-sentrykeep their fetch-based copies for now and can move over separately.Part of #23610
🤖 Generated with Claude Code