Skip to content

Commit b1b3481

Browse files
runningcodeclaude
andcommitted
test(spring-boot): Move the Boot 2 GraphQL and Kafka tests into the module
Ports the Boot 2 sample's GraphQL and Kafka tests to the integrationTest suite. Both need Spring Boot 2.7, while the Spring Boot 2 matrix also covers 2.4 to 2.6, so below 2.7 the suite leaves out their dependencies and sources. That also keeps the broker off the shared base class: the Kafka test runs its own application context under a kafka profile with @embeddedkafka, and each context gets its own in-memory database. The second context re-initializes the global SDK; the app reaches Sentry through ScopesAdapter, so the other tests pass in either order. The Boot 2 sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 2 matrix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b00abe3 commit b1b3481

18 files changed

Lines changed: 356 additions & 369 deletions

File tree

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ jobs:
7575
- name: Build sample artifacts
7676
run: |
7777
./gradlew \
78-
:sentry-samples:sentry-samples-spring-boot:shadowJar \
79-
:sentry-samples:sentry-samples-spring-boot:testClasses \
8078
:sentry-samples:sentry-samples-spring-boot-webflux:shadowJar \
8179
:sentry-samples:sentry-samples-spring-boot-webflux:testClasses \
8280
:sentry-samples:sentry-samples-spring-boot-opentelemetry:shadowJar \
@@ -90,13 +88,6 @@ jobs:
9088
- name: Test sentry-spring-boot integration suite
9189
run: ./gradlew :sentry-spring-boot:integrationTest
9290

93-
- name: Test sentry-samples-spring-boot
94-
run: |
95-
python3 test/system-test-runner.py test \
96-
--module "sentry-samples-spring-boot" \
97-
--agent false \
98-
--auto-init "true"
99-
10091
- name: Test sentry-samples-spring-boot-webflux
10192
run: |
10293
python3 test/system-test-runner.py test \

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
sample: [ "sentry-samples-spring-boot" ]
27+
sample: [ "sentry-samples-spring-boot-opentelemetry-noagent" ]
2828
agent: [ "false" ]
2929
agent-auto-init: [ "true" ]
3030
include:
31-
- sample: "sentry-samples-spring-boot-opentelemetry-noagent"
32-
agent: "false"
33-
agent-auto-init: "true"
3431
- sample: "sentry-samples-spring-boot-opentelemetry"
3532
agent: "true"
3633
agent-auto-init: "true"

‎gradle/libs.versions.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ spotless = "8.8.0"
4545
springboot2 = "2.7.18"
4646
springboot3 = "3.5.0"
4747
springboot4 = "4.1.0"
48+
springKafka2 = "2.8.11"
4849
springKafka3 = "3.3.5"
4950
sqldelight = "2.3.2"
5051

@@ -214,7 +215,8 @@ springboot3-starter-security = { module = "org.springframework.boot:spring-boot-
214215
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
215216
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
216217
springboot3-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot3" }
217-
spring-kafka2 = { module = "org.springframework.kafka:spring-kafka", version = "2.8.11" }
218+
spring-kafka2 = { module = "org.springframework.kafka:spring-kafka", version.ref = "springKafka2" }
219+
spring-kafka2-test = { module = "org.springframework.kafka:spring-kafka-test", version.ref = "springKafka2" }
218220
spring-kafka3 = { module = "org.springframework.kafka:spring-kafka", version.ref = "springKafka3" }
219221
spring-kafka3-test = { module = "org.springframework.kafka:spring-kafka-test", version.ref = "springKafka3" }
220222
spring-kafka4 = { module = "org.springframework.kafka:spring-kafka" }

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

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ plugins {
88
alias(libs.plugins.shadow)
99
alias(libs.plugins.kotlin.jvm)
1010
alias(libs.plugins.kotlin.spring)
11-
id("io.sentry.systemtest")
1211
}
1312

1413
application { mainClass.set("io.sentry.samples.spring.boot.SentryDemoApplication") }
@@ -84,18 +83,6 @@ dependencies {
8483
// database query tracing
8584
implementation(projects.sentryJdbc)
8685
runtimeOnly(libs.hsqldb)
87-
88-
testImplementation(projects.sentrySystemTestSupport)
89-
testImplementation(kotlin(Config.kotlinStdLib))
90-
testImplementation(libs.apollo3.kotlin)
91-
testImplementation(libs.kotlin.test.junit)
92-
testImplementation(libs.slf4j2.api)
93-
testImplementation(libs.springboot.starter.test) {
94-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
95-
}
96-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
97-
testImplementation("ch.qos.logback:logback-core:1.5.16")
98-
testImplementation("org.apache.httpcomponents:httpclient")
9986
}
10087

10188
val runtimeClasspath = configurations.named("runtimeClasspath")
@@ -135,32 +122,3 @@ configure<SourceSetContainer> {
135122
}
136123
}
137124
}
138-
139-
tasks.register<Test>("systemTest").configure {
140-
group = "verification"
141-
description = "Runs the System tests"
142-
143-
val test = project.extensions.getByType<SourceSetContainer>()["test"]
144-
testClassesDirs = test.output.classesDirs
145-
classpath = test.runtimeClasspath
146-
147-
maxParallelForks = 1
148-
149-
filter {
150-
includeTestsMatching("io.sentry.systemtest*")
151-
if (!includeGraphql) {
152-
excludeTestsMatching("io.sentry.systemtest.Graphql*")
153-
}
154-
if (!includeKafka) {
155-
excludeTestsMatching("io.sentry.systemtest.Kafka*")
156-
}
157-
// The other tests moved into sentry-spring-boot, so without GraphQL and Kafka none are left.
158-
isFailOnNoMatchingTests = includeGraphql || includeKafka
159-
}
160-
}
161-
162-
tasks.named("test").configure {
163-
require(this is Test)
164-
165-
filter { excludeTestsMatching("io.sentry.systemtest.*") }
166-
}

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)