Skip to content

test: [Sample Tests 32] Add end-to-end tests of the core APIs and a profiled transaction - #6324

Open
runningcode wants to merge 4 commits into
no/jul-integration-testfrom
no/core-integration-test
Open

runningcode wants to merge 4 commits into
no/jul-integration-testfrom
no/core-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Adds SentryEndToEndTest to sentry. It ports the core part of sentry-samples-console's system test, which ran the sample's JAR against the Python mock server. The test reports through the APIs an app uses without integrations, and checks what reaches MockSentryServer over the real HTTP transport:

  • a message at the scope's FATAL level and one at an explicit WARNING level;
  • an exception with its feature flag;
  • an event with a fingerprint and the DEBUG level;
  • a breadcrumb from an event processor, and none from the one a beforeBreadcrumb callback rejects;
  • ten events in a row, all of which arrive (the sample accepted five);
  • a transaction with a child span;
  • metrics, with the scope's attributes.

It also adds ContinuousProfilerEndToEndTest to sentry-async-profiler, which ports the sample's profiling check. A sampled transaction with the TRACE profile lifecycle starts the async profiler, and the test checks that the profile chunk reaches MockSentryServer with the transaction's profiler ID.

The traces path is in the temp dir. The profiler rejects a traces path with a . anywhere in its absolute form, as #6319 found, so a relative path fails in a checkout whose path has a dot in it.

The sample's test also runs a Kafka round trip. That goes to sentry-kafka in the next PR, which retires the sample.

The test's name avoids …IntegrationTest, which in this module means a test of an SDK Integration.

After a coverage audit against the sample's tests:

  • The exception check also asserts its type, RuntimeException, as the sample did.

💡 Motivation and Context

Core's unit tests mock the transport. SentryEndToEndTest is the one place where core's own APIs, with no framework integration, go through serialization and HTTP to a server. It runs in 0.2 seconds.

sentry-async-profiler's tests mock the transport and the profiler's surroundings. ContinuousProfilerEndToEndTest runs the real profiler and sends the chunk over HTTP, in under a second.

💚 How did you test it?

  • Both tests pass.
  • Expecting a different fingerprint makes SentryEndToEndTest fail.
  • Expecting the transaction to have no profiler ID makes ContinuousProfilerEndToEndTest fail.
  • In a checkout whose path contains /.claude/, 16 of JavaContinuousProfilerTest's tests fail with or without this PR: the same dot check disables profiling, and one test expects , as the rejected character and gets .. In CI, whose checkout path has no dot, they pass.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The console sample's Kafka round trip into sentry-kafka, which retires the sample.

#skip-changelog

🤖 Generated with Claude Code

This was referenced Oct 20, 2026
@runningcode
runningcode force-pushed the no/jul-integration-test branch from a2e1163 to 791e3f3 Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/core-integration-test branch from 8ace21b to 67c6c50 Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/jul-integration-test branch from 791e3f3 to 99a5992 Compare October 23, 2026 08:24
@runningcode
runningcode force-pushed the no/core-integration-test branch 4 times, most recently from d5be157 to ace7cb1 Compare October 23, 2026 11:51
@runningcode
runningcode force-pushed the no/jul-integration-test branch 2 times, most recently from 9f8011b to 1f6e18c Compare October 23, 2026 12:48
@runningcode
runningcode force-pushed the no/core-integration-test branch 2 times, most recently from 1254e97 to be7bcd3 Compare October 23, 2026 13:02
@runningcode
runningcode force-pushed the no/jul-integration-test branch 2 times, most recently from 99502e5 to 988d271 Compare October 23, 2026 13:53
@runningcode
runningcode force-pushed the no/core-integration-test branch from be7bcd3 to 4264fa8 Compare October 23, 2026 13:53
runningcode and others added 4 commits October 23, 2026 17:09
…nsport

SentryEndToEndTest reports through the APIs an app uses without
integrations and checks what reaches MockSentryServer: messages at the
scope's and an explicit level, an exception with its feature flag, an
event with a fingerprint, breadcrumbs from an event processor and a
beforeBreadcrumb callback, ten events in a row, a transaction with a
child span, and metrics with the scope's attributes.

It ports the core part of the console sample's system test, which ran
the sample's JAR against the Python mock server. The sample's profiling
and Kafka parts follow in their own modules.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n type end to end

The console sample's test checked that the captured exception arrives
with its type, RuntimeException, not just its value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d before exiting

The console samples' system tests ran each sample in its own JVM,
asserted that it exited with 0 within 30 seconds, and relied on the
shutdown hook to send everything, because the samples never flush or
close Sentry. The in-process end-to-end tests flush explicitly, so
neither the clean exit nor the hook's flush was tested any more.

Run a small app in a child JVM that returns from main without flushing,
and check that it exits with 0 and that its event, log and metric
arrive.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ContinuousProfilerEndToEndTest starts a sampled transaction with the
TRACE profile lifecycle and checks that its profile chunk reaches
MockSentryServer, linked to the transaction by the profiler ID. It
ports the profiling part of the console sample's system test.

The profiler rejects a traces path with a dot anywhere in its absolute
form, so the test puts it in the temp dir.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/jul-integration-test branch from 988d271 to ef54152 Compare October 23, 2026 15:10
@runningcode
runningcode force-pushed the no/core-integration-test branch from 4264fa8 to 8ebabb9 Compare October 23, 2026 15:10
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 26, 2026
@runningcode
runningcode marked this pull request as ready for review October 26, 2026 13:40
@runningcode runningcode changed the title test(core): [Sample Tests 32] Add an end-to-end test of the core APIs over the HTTP transport test: [Sample Tests 32] Add end-to-end tests of the core APIs and a profiled transaction Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant