Skip to content

Commit 574efe9

Browse files
runningcodeclaude
andauthored
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>
1 parent ead5c63 commit 574efe9

37 files changed

Lines changed: 1137 additions & 951 deletions

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

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ 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 \
7674
:sentry-samples:sentry-samples-spring-jakarta:war \
77-
:sentry-samples:sentry-samples-spring-jakarta:testClasses \
78-
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
75+
:sentry-samples:sentry-samples-spring-jakarta:testClasses
7976
8077
- name: Test sentry-spring-boot-jakarta integration suites
8178
run: |
@@ -84,21 +81,8 @@ jobs:
8481
:sentry-spring-boot-jakarta:integrationTestWebflux \
8582
:sentry-spring-boot-jakarta:integrationTestOtelNoAgent \
8683
:sentry-spring-boot-jakarta:integrationTestLog4j2 \
87-
:sentry-spring-boot-jakarta:integrationTestOtelAgent
88-
89-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init true
90-
run: |
91-
python3 test/system-test-runner.py test \
92-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
93-
--agent true \
94-
--auto-init "true"
95-
96-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init false
97-
run: |
98-
python3 test/system-test-runner.py test \
99-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
100-
--agent true \
101-
--auto-init "false"
84+
:sentry-spring-boot-jakarta:integrationTestOtelAgent \
85+
:sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit
10286
10387
- name: Test sentry-samples-spring-jakarta
10488
run: |

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ jobs:
3434
- sample: "sentry-samples-spring-boot-opentelemetry"
3535
agent: "true"
3636
agent-auto-init: "false"
37-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
38-
agent: "true"
39-
agent-auto-init: "true"
40-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
41-
agent: "true"
42-
agent-auto-init: "false"
4337
- sample: "sentry-samples-console-otlp"
4438
agent: "false"
4539
agent-auto-init: "true"

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

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

1312
group = "io.sentry.sample.spring-boot-jakarta"
@@ -61,17 +60,6 @@ dependencies {
6160
// database query tracing
6261
implementation(projects.sentryJdbc)
6362
runtimeOnly(libs.hsqldb)
64-
65-
testImplementation(kotlin(Config.kotlinStdLib))
66-
testImplementation(projects.sentrySystemTestSupport)
67-
testImplementation(libs.apollo3.kotlin)
68-
testImplementation(libs.kotlin.test.junit)
69-
testImplementation(libs.slf4j2.api)
70-
testImplementation(libs.springboot3.starter.test) {
71-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
72-
}
73-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
74-
testImplementation("ch.qos.logback:logback-core:1.5.16")
7563
}
7664

7765
tasks.register<BootRun>("bootRunWithAgent").configure {
@@ -105,25 +93,3 @@ tasks.register<BootRun>("bootRunWithAgent").configure {
10593

10694
jvmArgs = listOf("-Dotel.javaagent.debug=true", "-javaagent:$agentJarPath")
10795
}
108-
109-
// The runner launches this sample with -javaagent, so track the agent jar as a systemTest input.
110-
sentrySystemTest { usesOpenTelemetryAgent = true }
111-
112-
tasks.register<Test>("systemTest").configure {
113-
group = "verification"
114-
description = "Runs the System tests"
115-
116-
val test = project.extensions.getByType<SourceSetContainer>()["test"]
117-
testClassesDirs = test.output.classesDirs
118-
classpath = test.runtimeClasspath
119-
120-
maxParallelForks = 1
121-
122-
filter { includeTestsMatching("io.sentry.systemtest*") }
123-
}
124-
125-
tasks.named("test").configure {
126-
require(this is Test)
127-
128-
filter { excludeTestsMatching("io.sentry.systemtest.*") }
129-
}

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

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

‎sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/test/kotlin/io/sentry/systemtest/CacheSystemTest.kt‎

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

‎sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/test/kotlin/io/sentry/systemtest/DistributedTracingSystemTest.kt‎

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

0 commit comments

Comments
 (0)