Repository navigation
test(spring): [Sample Tests 27] Move the Spring jakarta WAR sample's tests into the module - #6319
Draft
runningcode wants to merge 2 commits into
Draft
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
Adds an integrationTest suite to sentry-spring-jakarta that runs a plain Spring MVC app, set up by an AbstractAnnotationConfigDispatcherServletInitializer as in a WAR, in an embedded Tomcat against MockSentryServer. Tomcat runs every servlet container initializer the classpath registers, as it does for a WAR, and Spring Boot stays off the classpath, so Sentry's initializer adds SentrySpringFilter the way it does in a real deployment. The suite ports the sample's Person and Metrics tests and also checks that the error carries its request. The profiler rejects a traces path with a dot anywhere in its absolute form, so the suite puts it in the temp dir. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 3 matrix. That was the matrix's last runner step, so it drops the Python setup and the runner's logs too. integrationTests includes the suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
PR Stack (Sample Tests)
main)📜 Description
Adds an
integrationTestsuite tosentry-spring-jakartathat runs a plain Spring MVC app, without Spring Boot, in an embedded Tomcat againstMockSentryServer. It portssentry-samples-spring-jakarta's Person and Metrics tests. The sample is the first WAR sample, and this PR settles how the WAR flavor moves: an embedded-Tomcat suite rather than adding to the existingmvc/SentrySpringIntegrationTest.Why a suite of its own.
SentrySpringIntegrationTestruns on Spring Boot with a mocked transport. The WAR samples cover what it can't:AbstractAnnotationConfigDispatcherServletInitializerstarts the app in a servlet container, and Sentry'sSentrySpringServletContainerInitializeraddsSentrySpringFilter, which it only does when Spring Boot is absent.sentry.propertiesand system properties.How the app starts. Like a servlet container does for a WAR, the suite has Tomcat run every
ServletContainerInitializerthat the classpath registers throughMETA-INF/services. Spring's initializer starts the app's initializer, and Sentry's addsSentrySpringFilter. Spring Boot is kept off the suite's classpath; only its BOM supplies versions. The tests use a plainRestTemplate, becauseTestRestTemplateis part of Spring Boot.Tests:
http.servertransaction and the logs;The sample's separate "create person works" test was a subset of the profile test, so it's folded in. The error also has to carry its request, which only
SentrySpringFilterattaches, so the test covers that path.Two SDK quirks the port ran into. Neither is fixed here.
.anywhere in its absolute form. A relative path in this worktree became…/.claude/worktrees/…, and profiling turned off. CI paths have no dot. The suite puts the path in the temp dir, like the Boot suites.With no system tests left, the sample comes off the runner, the backend workflow and the Spring Boot 3 matrix. That was the matrix's last runner step, so the matrix also drops the Python setup,
SENTRY_URLand the runner's log uploads.integrationTestsincludes the suite.💡 Motivation and Context
Plain Spring, without Boot, now runs end to end in the module. The suite runs 5 tests in about 2 seconds. The sample's version started Tomcat with a WAR and slept 10 seconds before checking the logs.
💚 How did you test it?
:sentry-spring-jakarta:checkpasses, and the sample's WAR still builds.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The
sentry-spring-7andsentry-springWAR samples, with the same shape.#skip-changelog
🤖 Generated with Claude Code