Skip to content

Commit 7400006

Browse files
runningcodeclaude
andauthored
test(spring-boot): [Sample Tests 21] Move the Boot 4 OTel no-agent sample's tests (#6313)
* test(spring-boot): Move the Boot 4 OTel no-agent sample's tests into the module Adds an integrationTestOtelNoAgent suite to sentry-spring-boot-4, the Boot 4 counterpart of the Boot 3 one: the app traces through the OpenTelemetry SDK in its own JVM, set up by sentry-opentelemetry-agentless-spring. The sample's tests were the same as the Boot 3 sample's, minus Cache, so the suite is the Boot 3 one with Boot 4's packages and no Cache test. Its Metrics tests were copies of the servlet ones and don't depend on tracing. 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 the new suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to Boot 4 no-agent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 22] Move the Boot 2 OTel no-agent sample's tests (#6314) * test(spring-boot): Move the Boot 2 OTel no-agent sample's tests into the module Adds an integrationTestOtelNoAgent suite to sentry-spring-boot, the Boot 2 counterpart of the Boot 3 one. The sample's tests were the Boot 3 sample's minus Cache and RestClient, which Boot 2 doesn't have. GraphQL and Kafka are gated on Boot 2.7, as in the servlet suite, and Kafka gets a context of its own. Sentry is global, so a second live context re-initializes it with that context's OpenTelemetry SDK, and the Sentry API spans of the first context's tests went to the wrong one. Each test class therefore starts its own context and closes it afterwards. The sample has no system tests left, so it comes off the system-test runner and the Spring Boot 2 matrix, which now runs the new suite, and the backend workflow's base row moves to the console sample. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Port the tracing and GraphQL checks to Boot 2 no-agent and restore Metrics Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 23] Port the Boot 3 OTel agent sample's Person, tracing and Todo tests (#6315) * test(spring-boot): Port the Boot 3 OTel agent sample's Person, tracing and Todo tests The agent tests now start the fixture app once per test JVM and share it, because it takes seconds to start. Which mode initializes Sentry is a property of the test task, so the suite's task runs with the agent initializing it and a new integrationTestOtelAgentWithoutAutoInit task runs the same tests with the Spring Boot starter doing it. Gradle runs the two in parallel. The fixture gains the Person POST, distributed tracing and Todo endpoints, and the suite ports the agent sample's Person, DistributedTracing and Todo tests. Sentry exports the agent's spans in batches every 5 seconds, which can't be configured, so each test waits for the next batch and the negative tracing check waits past one. ChildJvmApp now copies the app's output into the test's as it arrives instead of printing it on close. The shared app is closed when the JVM exits, where its whole log would otherwise land on the console. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: Port the audit fixes to the Boot 3 agent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): [Sample Tests 24] Port the rest of the Boot 3 OTel agent sample's tests (#6316) * test(spring-boot): Port the rest of the Boot 3 OTel agent sample's tests The agent fixture gains the Cache, Metrics, GraphQL and Kafka endpoints, and the agent suite ports the sample's remaining tests in both init modes. The agent traces each GraphQL operation as one span named after it, so the queries are named. Kafka uses an in-JVM KRaft broker that the test JVM starts next to the app. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 3 matrix. The matrix no longer builds the agent separately, because the suites build the jar they attach. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(spring-boot): Check the Boot 3 agent GraphQL task query's assignee and creator ids Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 0e762cf commit 7400006

93 files changed

Lines changed: 3280 additions & 2456 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,16 @@ jobs:
7777
./gradlew \
7878
:sentry-samples:sentry-samples-spring-boot-opentelemetry:shadowJar \
7979
:sentry-samples:sentry-samples-spring-boot-opentelemetry:testClasses \
80-
:sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:shadowJar \
81-
:sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:testClasses \
8280
:sentry-samples:sentry-samples-spring:war \
8381
:sentry-samples:sentry-samples-spring:testClasses \
8482
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
8583
8684
- name: Test sentry-spring-boot integration suites
87-
run: ./gradlew :sentry-spring-boot:integrationTest :sentry-spring-boot:integrationTestWebflux
85+
run: |
86+
./gradlew \
87+
:sentry-spring-boot:integrationTest \
88+
:sentry-spring-boot:integrationTestWebflux \
89+
:sentry-spring-boot:integrationTestOtelNoAgent
8890
8991
- name: Test sentry-samples-spring-boot-opentelemetry agent init true
9092
run: |
@@ -100,13 +102,6 @@ jobs:
100102
--agent true \
101103
--auto-init "false"
102104
103-
- name: Test sentry-samples-spring-boot-opentelemetry-noagent
104-
run: |
105-
python3 test/system-test-runner.py test \
106-
--module "sentry-samples-spring-boot-opentelemetry-noagent" \
107-
--agent false \
108-
--auto-init "true"
109-
110105
- name: Test sentry-samples-spring
111106
run: |
112107
python3 test/system-test-runner.py test \

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

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ jobs:
7171
- name: Build sample artifacts
7272
run: |
7373
./gradlew \
74-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry:bootJar \
75-
:sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry:testClasses \
7674
:sentry-samples:sentry-samples-spring-jakarta:war \
77-
:sentry-samples:sentry-samples-spring-jakarta:testClasses \
78-
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
75+
:sentry-samples:sentry-samples-spring-jakarta:testClasses
7976
8077
- name: Test sentry-spring-boot-jakarta integration suites
8178
run: |
@@ -84,21 +81,8 @@ jobs:
8481
:sentry-spring-boot-jakarta:integrationTestWebflux \
8582
:sentry-spring-boot-jakarta:integrationTestOtelNoAgent \
8683
:sentry-spring-boot-jakarta:integrationTestLog4j2 \
87-
:sentry-spring-boot-jakarta:integrationTestOtelAgent
88-
89-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init true
90-
run: |
91-
python3 test/system-test-runner.py test \
92-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
93-
--agent true \
94-
--auto-init "true"
95-
96-
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init false
97-
run: |
98-
python3 test/system-test-runner.py test \
99-
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
100-
--agent true \
101-
--auto-init "false"
84+
:sentry-spring-boot-jakarta:integrationTestOtelAgent \
85+
:sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit
10286
10387
- name: Test sentry-samples-spring-jakarta
10488
run: |

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ jobs:
7373
./gradlew \
7474
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:bootJar \
7575
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry:testClasses \
76-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry-noagent:bootJar \
77-
:sentry-samples:sentry-samples-spring-boot-4-opentelemetry-noagent:testClasses \
7876
:sentry-samples:sentry-samples-spring-7:war \
7977
:sentry-samples:sentry-samples-spring-7:testClasses \
8078
:sentry-opentelemetry:sentry-opentelemetry-agent:assemble
@@ -84,6 +82,7 @@ jobs:
8482
./gradlew \
8583
:sentry-spring-boot-4:integrationTest \
8684
:sentry-spring-boot-4:integrationTestWebflux \
85+
:sentry-spring-boot-4:integrationTestOtelNoAgent \
8786
:sentry-spring-boot-4:integrationTestLog4j2
8887
8988
- name: Run sentry-samples-spring-boot-4-opentelemetry agent init true
@@ -100,13 +99,6 @@ jobs:
10099
--agent true \
101100
--auto-init "false"
102101
103-
- name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
104-
run: |
105-
python3 test/system-test-runner.py test \
106-
--module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
107-
--agent false \
108-
--auto-init "true"
109-
110102
- name: Run sentry-samples-spring-7
111103
run: |
112104
python3 test/system-test-runner.py test \

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
sample: [ "sentry-samples-spring-boot-opentelemetry-noagent" ]
27+
sample: [ "sentry-samples-console" ]
2828
agent: [ "false" ]
2929
agent-auto-init: [ "true" ]
3030
include:
@@ -34,15 +34,6 @@ jobs:
3434
- sample: "sentry-samples-spring-boot-opentelemetry"
3535
agent: "true"
3636
agent-auto-init: "false"
37-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
38-
agent: "true"
39-
agent-auto-init: "true"
40-
- sample: "sentry-samples-spring-boot-jakarta-opentelemetry"
41-
agent: "true"
42-
agent-auto-init: "false"
43-
- sample: "sentry-samples-console"
44-
agent: "false"
45-
agent-auto-init: "true"
4637
- sample: "sentry-samples-console-otlp"
4738
agent: "false"
4839
agent-auto-init: "true"
@@ -52,9 +43,6 @@ jobs:
5243
- sample: "sentry-samples-jul"
5344
agent: "false"
5445
agent-auto-init: "true"
55-
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
56-
agent: "false"
57-
agent-auto-init: "true"
5846
- sample: "sentry-samples-spring-boot-4-opentelemetry"
5947
agent: "true"
6048
agent-auto-init: "true"

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

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

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

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

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

0 commit comments

Comments
 (0)