Skip to content

Commit b705c10

Browse files
runningcodeclaude
andauthored
test(spring-boot): [Sample Tests 14] Move the Boot 2 GraphQL and Kafka tests (#6300)
* 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> * test(spring-boot): Check the Boot 2 GraphQL task query's assignee and creator ids Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent e2a270b commit b705c10

18 files changed

Lines changed: 358 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
@@ -48,6 +48,7 @@ spotless = "8.8.0"
4848
springboot2 = "2.7.18"
4949
springboot3 = "3.5.0"
5050
springboot4 = "4.1.0"
51+
springKafka2 = "2.8.11"
5152
springKafka3 = "3.3.5"
5253
sqldelight = "2.3.2"
5354

@@ -221,7 +222,8 @@ springboot3-starter-security = { module = "org.springframework.boot:spring-boot-
221222
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
222223
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
223224
springboot3-starter-cache = { module = "org.springframework.boot:spring-boot-starter-cache", version.ref = "springboot3" }
224-
spring-kafka2 = { module = "org.springframework.kafka:spring-kafka", version = "2.8.11" }
225+
spring-kafka2 = { module = "org.springframework.kafka:spring-kafka", version.ref = "springKafka2" }
226+
spring-kafka2-test = { module = "org.springframework.kafka:spring-kafka-test", version.ref = "springKafka2" }
225227
spring-kafka3 = { module = "org.springframework.kafka:spring-kafka", version.ref = "springKafka3" }
226228
spring-kafka3-test = { module = "org.springframework.kafka:spring-kafka-test", version.ref = "springKafka3" }
227229
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
@@ -7,7 +7,6 @@ plugins {
77
alias(libs.plugins.shadow)
88
alias(libs.plugins.kotlin.jvm)
99
alias(libs.plugins.kotlin.spring)
10-
id("io.sentry.systemtest")
1110
}
1211

1312
// Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version
@@ -83,18 +82,6 @@ dependencies {
8382
// database query tracing
8483
implementation(projects.sentryJdbc)
8584
runtimeOnly(libs.hsqldb)
86-
87-
testImplementation(projects.sentrySystemTestSupport)
88-
testImplementation(kotlin(Config.kotlinStdLib))
89-
testImplementation(libs.apollo3.kotlin)
90-
testImplementation(libs.kotlin.test.junit)
91-
testImplementation(libs.slf4j2.api)
92-
testImplementation(libs.springboot.starter.test) {
93-
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
94-
}
95-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
96-
testImplementation("ch.qos.logback:logback-core:1.5.16")
97-
testImplementation("org.apache.httpcomponents:httpclient")
9885
}
9986

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

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