Skip to content

test(logback): [Sample Tests 3] Move the logback system test into the module - #6268

Merged
runningcode merged 2 commits into
mainfrom
no/logback-integration-test
Oct 22, 2026
Merged

runningcode merged 2 commits into
mainfrom
no/logback-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

This is the first PR that removes the python test server for the in process MockSentryServer. The separate 84s job is replaced by a test a single additional 3s test in the same module where the code lives.

How it runs on CI

Before: only in the System Tests Backend workflow's sentry-samples-logback job, which is continue-on-error. The Python runner builds the sample's shadow JAR, starts a Python mock Sentry server on port 8000 and runs the sample's systemTest task. That test launches the JAR as a child process and asks the mock server over HTTP for envelopes, retrying after a fixed 10s sleep. The Build job never ran it, because the sample's test task excluded it.

After: a regular test in :sentry-logback:test, so the Build job runs it with ./gradlew check. Everything happens in the test JVM: MockSentryServer listens on a random port, and the test configures logback, logs and waits for the envelopes. There's no sample JAR, child process or Python.

What it gives up: it no longer starts the packaged sample, so it doesn't check the sample's own logback.xml or its exit code.

More details describing this PR written by my agent:

  • configures a fresh LoggerContext from an XML file. The file has a non-default name so logback's auto-configuration ignores it, and the DSN is substituted from a context property;
  • logs the same sequence the sample's Main does;
  • asserts events, breadcrumbs, feature flags and logs on MockSentryServer;
  • also checks that the XML contextTag reaches the event as a tag, which the old test didn't.

The sample has no tests left, so this PR also removes:

  • its system-test wiring and test dependencies;
  • its Kotlin plugin, which only the tests used;
  • its entries in system-tests-backend.yml and in the runner's module list.

💡 Motivation and Context

Until now, only the sample system test covered the appender's XML binding. That test needed the Python runner and a shadow JAR, and it ran in a non-blocking CI job. It now runs in about 3s as part of :sentry-logback:test.

💚 How did you test it?

  • :sentry-logback:check passes.
  • Temporarily broke an attribute assertion to confirm the test fails, with a clear Truth message.
  • :sentry-samples:sentry-samples-logback:build still builds the sample's shadow JAR.

📝 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 log4j2 and JUL console samples follow the same pattern.

#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.1 (1) release

⚙️ sentry-android Build Distribution Settings

This was referenced Oct 20, 2026
runningcode and others added 2 commits October 21, 2026 12:59
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>
The test now configures the appender from XML in-process and sends to
MockSentryServer, so it runs as part of :sentry-logback:test instead of
needing the Python runner and a shadow JAR. It also checks that the XML
contextTag reaches the event.

The logback sample has no tests left, so its system-test wiring, CI
matrix entry and runner entry are removed.

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 force-pushed the no/logback-integration-test branch from 037ce0c to 81e1075 Compare October 21, 2026 11:27
Base automatically changed from no/shared-envelope-matchers to main October 21, 2026 11:53
@runningcode runningcode reopened this Oct 22, 2026
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 22, 2026
@runningcode
runningcode marked this pull request as ready for review October 22, 2026 09:13

@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 merged commit ff8c06c into main Oct 22, 2026
132 of 133 checks passed
@runningcode
runningcode deleted the no/logback-integration-test branch October 22, 2026 12:03
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