Skip to content

Commit a3d01cf

Browse files
committed
test(spring-boot): Move the Boot 4 OTel agent sample's tests into the module
Adds the agent setup to sentry-spring-boot-4: an agentFixture app that runs in a child JVM with the built agent attached, and the integrationTestOtelAgent suite with its integrationTestOtelAgentWithoutAutoInit task. The sample's tests were the same as the Boot 3 agent sample's, so the fixture and tests are the Boot 3 ones with Boot 4's packages and starters. 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 both agent tasks and no longer builds the agent separately. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent d41cdb9 commit a3d01cf

35 files changed

Lines changed: 1199 additions & 810 deletions

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,18 @@ jobs:
7171
- name: Build sample artifacts
7272
run: |
7373
./gradlew \
74-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:bootJar \
75-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:testClasses \
7674
:sentry-samples:sentry-samples-spring-7:war \
77-
:sentry-samples:sentry-samples-spring-7:testClasses \
78-
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
75+
:sentry-samples:sentry-samples-spring-7:testClasses
7976
8077
- name: Test sentry-spring-boot-4 integration suites
8178
run: |
8279
./gradlew \
8380
:sentry-spring-boot-4:integrationTest \
8481
:sentry-spring-boot-4:integrationTestWebflux \
8582
:sentry-spring-boot-4:integrationTestOtelNoAgent \
86-
:sentry-spring-boot-4:integrationTestLog4j2
87-
88-
- name: Run sentry-samples-spring-boot-4-opentelemetry agent init true
89-
run: |
90-
python3 test/system-test-runner.py test \
91-
--module "sentry-samples-spring-boot-4-opentelemetry" \
92-
--agent true \
93-
--auto-init "true"
94-
95-
- name: Run sentry-samples-spring-boot-4-opentelemetry agent init false
96-
run: |
97-
python3 test/system-test-runner.py test \
98-
--module "sentry-samples-spring-boot-4-opentelemetry" \
99-
--agent true \
100-
--auto-init "false"
83+
:sentry-spring-boot-4:integrationTestLog4j2 \
84+
:sentry-spring-boot-4:integrationTestOtelAgent \
85+
:sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit
10186
10287
- name: Run sentry-samples-spring-7
10388
run: |

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ jobs:
4343
- sample: "sentry-samples-jul"
4444
agent: "false"
4545
agent-auto-init: "true"
46-
- sample: "sentry-samples-spring-boot-4-opentelemetry"
47-
agent: "true"
48-
agent-auto-init: "true"
49-
- sample: "sentry-samples-spring-boot-4-opentelemetry"
50-
agent: "true"
51-
agent-auto-init: "false"
5246
- sample: "sentry-samples-spring-boot-4-otlp"
5347
agent: "false"
5448
agent-auto-init: "true"

‎sentry-samples/sentry-samples-spring-boot-4-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-4"
@@ -59,17 +58,6 @@ dependencies {
5958
// database query tracing
6059
implementation(projects.sentryJdbc)
6160
runtimeOnly(libs.hsqldb)
62-
63-
testImplementation(kotlin(Config.kotlinStdLib))
64-
testImplementation(projects.sentrySystemTestSupport)
65-
testImplementation(libs.apollo3.kotlin)
66-
testImplementation(libs.kotlin.test.junit)
67-
testImplementation(libs.slf4j2.api)
68-
testImplementation(libs.springboot4.starter.test) {
69-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
70-
}
71-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
72-
testImplementation("ch.qos.logback:logback-core:1.5.16")
7361
}
7462

7563
tasks.register<BootRun>("bootRunWithAgent").configure {
@@ -96,25 +84,3 @@ tasks.register<BootRun>("bootRunWithAgent").configure {
9684

9785
jvmArgs = listOf("-Dotel.javaagent.debug=true", "-javaagent:$agentJarPath")
9886
}
99-
100-
// The runner launches this sample with -javaagent, so track the agent jar as a systemTest input.
101-
sentrySystemTest { usesOpenTelemetryAgent = true }
102-
103-
tasks.register<Test>("systemTest").configure {
104-
group = "verification"
105-
description = "Runs the System tests"
106-
107-
val test = project.extensions.getByType<SourceSetContainer>()["test"]
108-
testClassesDirs = test.output.classesDirs
109-
classpath = test.runtimeClasspath
110-
111-
maxParallelForks = 1
112-
113-
filter { includeTestsMatching("io.sentry.systemtest*") }
114-
}
115-
116-
tasks.named("test").configure {
117-
require(this is Test)
118-
119-
filter { excludeTestsMatching("io.sentry.systemtest.*") }
120-
}

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

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

‎sentry-samples/sentry-samples-spring-boot-4-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-4-opentelemetry/src/test/kotlin/io/sentry/systemtest/DistributedTracingSystemTest.kt‎

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

0 commit comments

Comments
 (0)