Skip to content

Commit c5a65dc

Browse files
committed
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. It was the backend workflow's last sample, so the workflow goes too. The Spring Boot 4 matrix runs the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent dbadd5b commit c5a65dc

30 files changed

Lines changed: 979 additions & 757 deletions

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

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

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

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

‎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"
@@ -54,37 +53,6 @@ dependencies {
5453
// database query tracing
5554
implementation(projects.sentryJdbc)
5655
runtimeOnly(libs.hsqldb)
57-
58-
testImplementation(kotlin(Config.kotlinStdLib))
59-
testImplementation(projects.sentry)
60-
testImplementation(projects.sentrySystemTestSupport)
61-
testImplementation(libs.apollo3.kotlin)
62-
testImplementation(libs.kotlin.test.junit)
63-
testImplementation(libs.slf4j2.api)
64-
testImplementation(libs.springboot4.starter.test) {
65-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
66-
}
67-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
68-
testImplementation("ch.qos.logback:logback-core:1.5.16")
6956
}
7057

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

‎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.

0 commit comments

Comments
 (0)