Skip to content

Commit 76b6904

Browse files
committed
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>
1 parent 9b517a7 commit 76b6904

25 files changed

Lines changed: 486 additions & 383 deletions

File tree

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

Lines changed: 1 addition & 18 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: |
@@ -87,20 +84,6 @@ jobs:
8784
:sentry-spring-boot-jakarta:integrationTestOtelAgent \
8885
:sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit
8986
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-
10487
- name: Test sentry-samples-spring-jakarta
10588
run: |
10689
python3 test/system-test-runner.py test \

‎.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/GraphqlGreetingSystemTest.kt‎

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)