Skip to content

test: [Sample Tests 2] Share the system-test envelope matchers - #6267

Merged
runningcode merged 1 commit into
mainfrom
no/shared-envelope-matchers
Oct 21, 2026
Merged

runningcode merged 1 commit into
mainfrom
no/shared-envelope-matchers

Conversation

@runningcode

@runningcode runningcode commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Moves the envelope matchers from TestHelper (sentry-system-test-support) into sentry-test-support, as extension functions. I note that these should probably use truth but i didn't want to make the diff any bigger.

This has no effect on production code.

My agent also did the following cleanups along the way:

  • Two pairs of near-identical TestHelper methods each map onto one matcher with optional parameters:
    • doesTransactionHaveOp and doesTransactionHave → hasOp
    • doesTransactionContainSpanWithOp and doesTransactionHaveSpanWith → hasSpanWithOp
  • The unused doesTransactionContainSpanWithDescription is dropped.
  • TestHelper.logObject used PrintWriter(System.out).use {}, which closes System.out and silenced every line after the first mismatch. It now flushes instead.

💡 Motivation and Context

The in-module integration tests in the following PRs need these matchers. They can't depend on sentry-system-test-support, because that module brings in:

  • Apollo 4;
  • okhttp 4, which clashes with the okhttp 5 modules;
  • hardcoded ports.

💚 How did you test it?

Passes CI and test. Code is the same, just rearranging it.

📝 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 next PRs use the matchers to move the logback sample's test and to test the OTel agent.
  • Once the last sample test is gone, TestHelper and sentry-system-test-support are deleted.

#skip-changelog

@sentry

sentry Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

This was referenced Oct 20, 2026
Base automatically changed from no/mock-sentry-server to main October 21, 2026 08:07
@runningcode
runningcode force-pushed the no/shared-envelope-matchers branch from cf186ed to 0959ce2 Compare October 21, 2026 08:57
@runningcode
runningcode marked this pull request as ready for review October 21, 2026 09:29
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 21, 2026

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@runningcode
runningcode enabled auto-merge (squash) October 21, 2026 10:55
@runningcode
runningcode disabled auto-merge October 21, 2026 10:55
In-module integration tests need the same envelope matchers the sample
system tests use. TestHelper now delegates to the shared copies, so the
sample tests keep working unchanged while they are moved.

Mismatch diagnostics now flush System.out instead of closing it, which
silenced all output after the first mismatch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/shared-envelope-matchers branch from 0959ce2 to c7cf960 Compare October 21, 2026 11:27
@runningcode
runningcode merged commit b731c0b into main Oct 21, 2026
64 of 66 checks passed
@runningcode
runningcode deleted the no/shared-envelope-matchers branch October 21, 2026 11:53
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.

2 participants