Skip to content

Commit 736fe25

Browse files
runningcodeclaude
andcommitted
test(spring-boot): Move the Boot 4 OTLP sample's tests into the module
Adds an integrationTestOtlp suite to sentry-spring-boot-4: the servlet app with the OpenTelemetry Spring Boot starter, set up by sentry-opentelemetry-otlp-spring, and OpenTelemetryOtlpEventProcessor. It ports the sample's tests, which were the servlet suite's without OkHttp, and keeps the log and metric attribute checks the sample had dropped. The sample's transactions came from Sentry's own tracing, which CI enabled with SENTRY_TRACES_SAMPLE_RATE, so the suite sets the sample rate the same way. A new test checks what OTLP mode is for: an error in a request carries the request's OpenTelemetry trace. Events point at that trace rather than at Sentry's transaction, so the GraphQL errors are checked next to their transactions instead of by trace ID, as the sample did. The sample has no system tests left, so it comes off the system-test runner and the backend workflow. The Spring Boot 4 matrix and integrationTests run the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 044ead9 commit 736fe25

31 files changed

Lines changed: 982 additions & 684 deletions

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ jobs:
6565
:sentry-spring-boot-4:integrationTestWebflux \
6666
:sentry-spring-boot-4:integrationTestOtelNoAgent \
6767
:sentry-spring-boot-4:integrationTestOtelAgent \
68-
:sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit
68+
:sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit \
69+
:sentry-spring-boot-4:integrationTestOtlp
6970
7071
- name: Upload test results
7172
if: always()

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
sample: [ "sentry-samples-spring-boot-4-otlp" ]
27+
sample: [ "sentry-samples-logback" ]
2828
agent: [ "false" ]
2929
agent-auto-init: [ "true" ]
30-
include:
31-
- sample: "sentry-samples-logback"
32-
agent: "false"
33-
agent-auto-init: "true"
3430
steps:
3531
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3632
with:

‎build.gradle.kts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ tasks.register("integrationTests") {
255255
":sentry-spring-boot-4:integrationTestOtelNoAgent",
256256
":sentry-spring-boot-4:integrationTestOtelAgent",
257257
":sentry-spring-boot-4:integrationTestOtelAgentWithoutAutoInit",
258+
":sentry-spring-boot-4:integrationTestOtlp",
258259
":sentry-spring:integrationTest",
259260
":sentry-spring-jakarta:integrationTest",
260261
":sentry-spring-7:integrationTest",

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

Lines changed: 0 additions & 32 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-otlp"
@@ -64,37 +63,6 @@ dependencies {
6463
// database query tracing
6564
implementation(projects.sentryJdbc)
6665
runtimeOnly(libs.hsqldb)
67-
68-
testImplementation(kotlin(Config.kotlinStdLib))
69-
testImplementation(projects.sentry)
70-
testImplementation(projects.sentrySystemTestSupport)
71-
testImplementation(libs.apollo3.kotlin)
72-
testImplementation(libs.kotlin.test.junit)
73-
testImplementation(libs.slf4j2.api)
74-
testImplementation(libs.springboot4.starter.test) {
75-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
76-
}
77-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
78-
testImplementation("ch.qos.logback:logback-core:1.5.16")
7966
}
8067

8168
dependencyManagement { imports { mavenBom(libs.otel.instrumentation.bom.get().toString()) } }
82-
83-
tasks.register<Test>("systemTest").configure {
84-
group = "verification"
85-
description = "Runs the System tests"
86-
87-
val test = project.extensions.getByType<SourceSetContainer>()["test"]
88-
testClassesDirs = test.output.classesDirs
89-
classpath = test.runtimeClasspath
90-
91-
maxParallelForks = 1
92-
93-
filter { includeTestsMatching("io.sentry.systemtest*") }
94-
}
95-
96-
tasks.named("test").configure {
97-
require(this is Test)
98-
99-
filter { excludeTestsMatching("io.sentry.systemtest.*") }
100-
}

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

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

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

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

‎sentry-samples/sentry-samples-spring-boot-4-otlp/src/test/kotlin/io/sentry/systemtest/GraphqlGreetingSystemTest.kt‎

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

0 commit comments

Comments
 (0)