Skip to content

Commit 505a823

Browse files
runningcodeclaude
andauthored
test(spring-boot): [Sample Tests 18] Move the Boot 4 WebFlux sample's tests into the module (#6310)
* test(spring-boot): Move the Boot 4 WebFlux sample's tests into the module Adds an integrationTestWebflux suite to sentry-spring-boot-4 that mirrors the Boot 3 one, adjusted for Spring Boot 4: the webclient starter for WebClient.Builder, the restclient starter that TestRestTemplate needs, Jackson 3, and @AutoConfigureTestRestTemplate. The Todo test reads the port with @LocalServerPort because TestRestTemplate's root URI doesn't hold the port on Boot 4.0. The Boot 4 WebFlux sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 4 matrix, which now runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to Boot 4 WebFlux Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Return a Mono from the Boot 4 WebFlux GraphQL resolver The sample's resolver returned a Mono, so its test covered Sentry finishing the field's span when the Mono completes. The port returned a String, which only covers the synchronous path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 19] Move the Boot 2 WebFlux sample's tests into the module (#6311) * test(spring-boot): Move the Boot 2 WebFlux sample's tests into the module Adds an integrationTestWebflux suite to sentry-spring-boot that mirrors the Boot 3 one, without the Reactor thread-local accessor that Spring Boot 2's Reactor lacks. The GraphQL greeting lives in its own file so the suite can leave it out below Spring Boot 2.7, like the servlet suite's GraphQL. The Boot 2 WebFlux sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 2 matrix, which now runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Tighten the Boot 2 WebFlux tracing checks and restore Metrics Ports the tracing checks and the plain test client from the servlet suite, and runs the WebFlux sample's Metrics tests in the reactive app too, rather than only in the servlet suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Return a Mono from the Boot 2 WebFlux GraphQL resolver The sample's resolver returned a Mono, so its test covered Sentry finishing the field's span when the Mono completes. The port returned a String, which only covers the synchronous path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 20] Move the Boot 3 OTel no-agent sample's tests (#6312) * test(spring-boot): Move the Boot 3 OTel no-agent sample's tests into the module Adds an integrationTestOtelNoAgent suite to sentry-spring-boot-jakarta. The app traces through the OpenTelemetry SDK in its own JVM, set up by sentry-opentelemetry-agentless-spring, and the suite ports the no-agent sample's tests: spans from the OTel annotation, the OTel API and the Sentry API with their feature flags, the OTel database span, trace continuation, client spans, cache spans, GraphQL, and Kafka traced by OTel instead of Sentry's Spring Kafka integration. The sample's Metrics tests were copies of the servlet ones and don't depend on tracing. The suite needs a TestRestTemplate built outside the context: the one Spring Boot provides is instrumented by the OTel starter, which replaced the trace headers the tests send and started a new trace. Sentry exports OTel spans in batches every 5 seconds, so every test waited that long. MockSentryServer gets a hook that runs before each check while waiting, which the suite uses to flush the tracer provider, taking the suite from about 112s to 8s of test time. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 3 matrix, which now runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Rejoin a wrapped comment in the Boot 3 OTel no-agent suite Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to Boot 3 no-agent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 21] Move the Boot 4 OTel no-agent sample's tests (#6313) * test(spring-boot): Move the Boot 4 OTel no-agent sample's tests into the module Adds an integrationTestOtelNoAgent suite to sentry-spring-boot-4, the Boot 4 counterpart of the Boot 3 one: the app traces through the OpenTelemetry SDK in its own JVM, set up by sentry-opentelemetry-agentless-spring. The sample's tests were the same as the Boot 3 sample's, minus Cache, so the suite is the Boot 3 one with Boot 4's packages and no Cache test. Its Metrics tests were copies of the servlet ones and don't depend on tracing. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 4 matrix, which now runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to Boot 4 no-agent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 22] Move the Boot 2 OTel no-agent sample's tests (#6314) * test(spring-boot): Move the Boot 2 OTel no-agent sample's tests into the module Adds an integrationTestOtelNoAgent suite to sentry-spring-boot, the Boot 2 counterpart of the Boot 3 one. The sample's tests were the Boot 3 sample's minus Cache and RestClient, which Boot 2 doesn't have. GraphQL and Kafka are gated on Boot 2.7, as in the servlet suite, and Kafka gets a context of its own. Sentry is global, so a second live context re-initializes it with that context's OpenTelemetry SDK, and the Sentry API spans of the first context's tests went to the wrong one. Each test class therefore starts its own context and closes it afterwards. The sample has no system tests left, so it comes off the system-test runner and the Spring Boot 2 matrix, which now runs the new suite, and the backend workflow's base row moves to the console sample. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Port the tracing and GraphQL checks to Boot 2 no-agent and restore Metrics Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 23] Port the Boot 3 OTel agent sample's Person, tracing and Todo tests (#6315) * test(spring-boot): Port the Boot 3 OTel agent sample's Person, tracing and Todo tests The agent tests now start the fixture app once per test JVM and share it, because it takes seconds to start. Which mode initializes Sentry is a property of the test task, so the suite's task runs with the agent initializing it and a new integrationTestOtelAgentWithoutAutoInit task runs the same tests with the Spring Boot starter doing it. Gradle runs the two in parallel. The fixture gains the Person POST, distributed tracing and Todo endpoints, and the suite ports the agent sample's Person, DistributedTracing and Todo tests. Sentry exports the agent's spans in batches every 5 seconds, which can't be configured, so each test waits for the next batch and the negative tracing check waits past one. ChildJvmApp now copies the app's output into the test's as it arrives instead of printing it on close. The shared app is closed when the JVM exits, where its whole log would otherwise land on the console. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to the Boot 3 agent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 24] Port the rest of the Boot 3 OTel agent sample's tests (#6316) * test(spring-boot): Port the rest of the Boot 3 OTel agent sample's tests The agent fixture gains the Cache, Metrics, GraphQL and Kafka endpoints, and the agent suite ports the sample's remaining tests in both init modes. The agent traces each GraphQL operation as one span named after it, so the queries are named. Kafka uses an in-JVM KRaft broker that the test JVM starts next to the app. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 3 matrix. The matrix no longer builds the agent separately, because the suites build the jar they attach. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Check the Boot 3 agent GraphQL task query's assignee and creator ids Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 5600ede commit 505a823

162 files changed

Lines changed: 5708 additions & 4292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/spring-boot-2-matrix.yml‎

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,18 @@ jobs:
7575
- name: Build sample artifacts
7676
run: |
7777
./gradlew \
78-
:sentry-samples:sentry-samples-spring-boot-webflux:shadowJar \
79-
:sentry-samples:sentry-samples-spring-boot-webflux:testClasses \
8078
:sentry-samples:sentry-samples-spring-boot-opentelemetry:shadowJar \
8179
:sentry-samples:sentry-samples-spring-boot-opentelemetry:testClasses \
82-
:sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:shadowJar \
83-
:sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:testClasses \
8480
:sentry-samples:sentry-samples-spring:war \
8581
:sentry-samples:sentry-samples-spring:testClasses \
8682
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
8783
88-
- name: Test sentry-spring-boot integration suite
89-
run: ./gradlew :sentry-spring-boot:integrationTest
90-
91-
- name: Test sentry-samples-spring-boot-webflux
84+
- name: Test sentry-spring-boot integration suites
9285
run: |
93-
python3 test/system-test-runner.py test \
94-
--module "sentry-samples-spring-boot-webflux" \
95-
--agent false \
96-
--auto-init "true"
86+
./gradlew \
87+
:sentry-spring-boot:integrationTest \
88+
:sentry-spring-boot:integrationTestWebflux \
89+
:sentry-spring-boot:integrationTestOtelNoAgent
9790
9891
- name: Test sentry-samples-spring-boot-opentelemetry agent init true
9992
run: |
@@ -109,13 +102,6 @@ jobs:
109102
--agent true \
110103
--auto-init "false"
111104
112-
- name: Test sentry-samples-spring-boot-opentelemetry-noagent
113-
run: |
114-
python3 test/system-test-runner.py test \
115-
--module "sentry-samples-spring-boot-opentelemetry-noagent" \
116-
--agent false \
117-
--auto-init "true"
118-
119105
- name: Test sentry-samples-spring
120106
run: |
121107
python3 test/system-test-runner.py test \

‎.github/workflows/spring-boot-3-matrix.yml‎

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,42 +71,18 @@ jobs:
7171
- name: Build sample artifacts
7272
run: |
7373
./gradlew \
74-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry:bootJar \
75-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry:testClasses \
76-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry-noagent:bootJar \
77-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry-noagent:testClasses \
7874
:sentry-samples:sentry-samples-spring-jakarta:war \
79-
:sentry-samples:sentry-samples-spring-jakarta:testClasses \
80-
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
75+
:sentry-samples:sentry-samples-spring-jakarta:testClasses
8176
8277
- name: Test sentry-spring-boot-jakarta integration suites
8378
run: |
8479
./gradlew \
8580
:sentry-spring-boot-jakarta:integrationTest \
8681
:sentry-spring-boot-jakarta:integrationTestWebflux \
82+
:sentry-spring-boot-jakarta:integrationTestOtelNoAgent \
8783
:sentry-spring-boot-jakarta:integrationTestLog4j2 \
88-
:sentry-spring-boot-jakarta:integrationTestOtelAgent
89-
90-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init true
91-
run: |
92-
python3 test/system-test-runner.py test \
93-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
94-
--agent true \
95-
--auto-init "true"
96-
97-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init false
98-
run: |
99-
python3 test/system-test-runner.py test \
100-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
101-
--agent true \
102-
--auto-init "false"
103-
104-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry-noagent
105-
run: |
106-
python3 test/system-test-runner.py test \
107-
--module "sentry-samples-spring-boot-jakarta-opentelemetry-noagent" \
108-
--agent false \
109-
--auto-init "true"
84+
:sentry-spring-boot-jakarta:integrationTestOtelAgent \
85+
:sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit
11086
11187
- name: Test sentry-samples-spring-jakarta
11288
run: |

‎.github/workflows/spring-boot-4-matrix.yml‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,19 @@ jobs:
7171
- name: Build sample artifacts
7272
run: |
7373
./gradlew \
74-
:sentry-samples:sentry-samples-spring-boot-4-webflux:bootJar \
75-
:sentry-samples:sentry-samples-spring-boot-4-webflux:testClasses \
7674
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:bootJar \
7775
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:testClasses \
78-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry-noagent:bootJar \
79-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry-noagent:testClasses \
8076
:sentry-samples:sentry-samples-spring-7:war \
8177
:sentry-samples:sentry-samples-spring-7:testClasses \
8278
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
8379
84-
- name: Test sentry-spring-boot-4 integration suite
85-
run: ./gradlew :sentry-spring-boot-4:integrationTest :sentry-spring-boot-4:integrationTestLog4j2
86-
87-
- name: Run sentry-samples-spring-boot-4-webflux
80+
- name: Test sentry-spring-boot-4 integration suites
8881
run: |
89-
python3 test/system-test-runner.py test \
90-
--module "sentry-samples-spring-boot-4-webflux" \
91-
--agent false \
92-
--auto-init "true"
82+
./gradlew \
83+
:sentry-spring-boot-4:integrationTest \
84+
:sentry-spring-boot-4:integrationTestWebflux \
85+
:sentry-spring-boot-4:integrationTestOtelNoAgent \
86+
:sentry-spring-boot-4:integrationTestLog4j2
9387
9488
- name: Run sentry-samples-spring-boot-4-opentelemetry agent init true
9589
run: |
@@ -105,13 +99,6 @@ jobs:
10599
--agent true \
106100
--auto-init "false"
107101
108-
- name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
109-
run: |
110-
python3 test/system-test-runner.py test \
111-
--module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
112-
--agent false \
113-
--auto-init "true"
114-
115102
- name: Run sentry-samples-spring-7
116103
run: |
117104
python3 test/system-test-runner.py test \

‎.github/workflows/system-tests-backend.yml‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
sample: [ "sentry-samples-spring-boot-opentelemetry-noagent" ]
27+
sample: [ "sentry-samples-console" ]
2828
agent: [ "false" ]
2929
agent-auto-init: [ "true" ]
3030
include:
@@ -34,21 +34,6 @@ jobs:
3434
- sample: "sentry-samples-spring-boot-opentelemetry"
3535
agent: "true"
3636
agent-auto-init: "false"
37-
- sample: "sentry-samples-spring-boot-webflux"
38-
agent: "false"
39-
agent-auto-init: "true"
40-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry-noagent"
41-
agent: "false"
42-
agent-auto-init: "true"
43-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
44-
agent: "true"
45-
agent-auto-init: "true"
46-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
47-
agent: "true"
48-
agent-auto-init: "false"
49-
- sample: "sentry-samples-console"
50-
agent: "false"
51-
agent-auto-init: "true"
5237
- sample: "sentry-samples-console-otlp"
5338
agent: "false"
5439
agent-auto-init: "true"
@@ -58,12 +43,6 @@ jobs:
5843
- sample: "sentry-samples-jul"
5944
agent: "false"
6045
agent-auto-init: "true"
61-
- sample: "sentry-samples-spring-boot-4-webflux"
62-
agent: "false"
63-
agent-auto-init: "true"
64-
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
65-
agent: "false"
66-
agent-auto-init: "true"
6746
- sample: "sentry-samples-spring-boot-4-opentelemetry"
6847
agent: "true"
6948
agent-auto-init: "true"

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ plugins {
66
alias(libs.plugins.spring.dependency.management)
77
alias(libs.plugins.kotlin.jvm)
88
alias(libs.plugins.kotlin.spring)
9-
id("io.sentry.systemtest")
109
}
1110

1211
group = "io.sentry.sample.spring-boot-4"
@@ -54,36 +53,6 @@ dependencies {
5453
// database query tracing
5554
implementation(projects.sentryJdbc)
5655
runtimeOnly(libs.hsqldb)
57-
58-
testImplementation(kotlin(Config.kotlinStdLib))
59-
testImplementation(projects.sentrySystemTestSupport)
60-
testImplementation(libs.apollo3.kotlin)
61-
testImplementation(libs.kotlin.test.junit)
62-
testImplementation(libs.slf4j2.api)
63-
testImplementation(libs.springboot4.starter.test) {
64-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
65-
}
66-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
67-
testImplementation("ch.qos.logback:logback-core:1.5.16")
6856
}
6957

7058
dependencyManagement { imports { mavenBom(libs.otel.instrumentation.bom.get().toString()) } }
71-
72-
tasks.register<Test>("systemTest").configure {
73-
group = "verification"
74-
description = "Runs the System tests"
75-
76-
val test = project.extensions.getByType<SourceSetContainer>()["test"]
77-
testClassesDirs = test.output.classesDirs
78-
classpath = test.runtimeClasspath
79-
80-
maxParallelForks = 1
81-
82-
filter { includeTestsMatching("io.sentry.systemtest*") }
83-
}
84-
85-
tasks.named("test").configure {
86-
require(this is Test)
87-
88-
filter { excludeTestsMatching("io.sentry.systemtest.*") }
89-
}

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/src/test/kotlin/io/sentry/DummyTest.kt‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)