Skip to content

Commit 9634d01

Browse files
authored
Merge branch 'main' into 08-04-add_new_modules_for_spring_7_and_spring_boot_4
2 parents ff7c269 + ee747ae commit 9634d01

File tree

14 files changed

+388
-114
lines changed

14 files changed

+388
-114
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ jobs:
7878
- sample: "sentry-samples-spring-boot-4-opentelemetry"
7979
agent: "true"
8080
agent-auto-init: "false"
81+
- sample: "sentry-samples-spring-jakarta"
82+
agent: "false"
83+
agent-auto-init: "true"
8184
steps:
8285
- uses: actions/checkout@v4
8386
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ distributions/
2121
sentry-spring-boot-starter-jakarta/src/main/resources/META-INF/spring.factories
2222
sentry-samples/sentry-samples-spring-boot-jakarta/spy.log
2323
sentry-mock-server.txt
24+
tomcat-server.txt
2425
spring-server.txt
26+
*.pid
2527
spy.log
2628
.kotlin
29+
**/tomcat.8080/webapps/

.sauce/sentry-uitest-android-benchmark-lite.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ espresso:
1818

1919
suites:
2020

21-
- name: "Android 11 (api 30)"
21+
- name: "Android 15 Benchmark lite (api 35)"
2222
testOptions:
2323
clearPackageData: true
2424
useTestOrchestrator: true
2525
devices:
26-
- id: Google_Pixel_3a_real # Google Pixel 3a - api 30 (11)
26+
- name: ".*"
27+
platformVersion: "15"
2728

2829
artifacts:
2930
download:

.sauce/sentry-uitest-android-benchmark.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,34 @@ espresso:
1919
suites:
2020

2121
# Devices are chosen so that there is a high-end and a low-end device for each api level
22-
- name: "Android 12 (api 31)"
22+
- name: "Android 15 (api 35)"
2323
testOptions:
2424
clearPackageData: true
2525
useTestOrchestrator: true
2626
devices:
27-
- id: Google_Pixel_6_Pro_real_us # Google Pixel 6 Pro - api 31 (12) - high end
28-
- id: Google_Pixel_5_12_real_us # Google Pixel 5 - api 31 (12) - low end
27+
- id: Google_Pixel_9_Pro_XL_15_real_sjc1 # Google Pixel 9 Pro XL - api 35 (15) - high end
28+
- id: Samsung_Galaxy_S23_15_real_sjc1 # Samsung Galaxy S23 - api 35 (15) - mid end
29+
- id: Google_Pixel_6a_15_real_sjc1 # Google Pixel 6a - api 35 (15) - low end
2930

30-
- name: "Android 11 (api 30)"
31+
- name: "Android 14 (api 34)"
3132
testOptions:
3233
clearPackageData: true
3334
useTestOrchestrator: true
3435
devices:
35-
- id: Samsung_Galaxy_S10_Plus_11_real_us # Samsung Galaxy S10+ - api 30 (11) - high end
36-
- id: Google_Pixel_4a_real_us # Google Pixel 4a - api 30 (11) - mid end
37-
- id: Google_Pixel_3a_real # Google Pixel 3a - api 30 (11) - low end
36+
- id: Google_Pixel_9_Pro_XL_real_sjc1 # Google Pixel 9 Pro XL - api 34 (14) - high end
37+
- id: Samsung_Galaxy_A54_real_sjc1 # Samsung Galaxy A54 - api 34 (14) - low end
3838

39-
- name: "Android 10 (api 29)"
39+
- name: "Android 13 (api 33)"
4040
testOptions:
4141
clearPackageData: true
4242
useTestOrchestrator: true
4343
devices:
44-
- id: Google_Pixel_3a_XL_real # Google Pixel 3a XL - api 29 (10)
45-
- id: OnePlus_6T_real # OnePlus 6T - api 29 (10)
44+
- id: Google_Pixel_7_Pro_real_us # Google Pixel 7 Pro - api 33 (13) - high end
45+
- id: Samsung_Galaxy_A32_5G_real_sjc1 # Samsung Galaxy A32 5G - api 33 (13) - low end
4646

47-
# At the time of writing (July, 4, 2022), the market share per android version is:
48-
# 12.0 = 17.54%, 11.0 = 31.65%, 10.0 = 21.92%
49-
# Using these 3 versions we cover 71,11% of all devices out there. Currently, this is enough for benchmarking scope
50-
# Leaving these devices here in case we change mind on them
51-
# devices:
52-
# - id: Samsung_Galaxy_S8_plus_real_us # Samsung Galaxy S8+ - api 28 (9)
53-
# - id: LG_G8_ThinQ_real_us # LG G8 ThinQ - api 28 (9)
54-
# - id: OnePlus_5_real_us # OnePlus 5 - api 27 (8.1.0)
55-
# - id: LG_K30_real_us1 # LG K30 - api 27 (8.1.0)
56-
# - id: HTC_10_real_us # HTC 10 - api 26 (8.0.0)
57-
# - id: Samsung_A3_real # Samsung Galaxy A3 2017 - api 26 (8.0.0)
58-
# - id: ZTE_Axon_7_real2_us # ZTE Axon 7 - api 25 (7.1.1)
59-
# - id: Motorola_Moto_X_Play_real # Motorola Moto X Play - api 25 (7.1.1)
60-
# - id: Samsung_note_5_real_us # Samsung Galaxy Note 5 - api 24 (7.0)
61-
# - id: LG_K10_real # LG K10 - api 24 (7.0)
62-
# - id: Samsung_Galaxy_S6_Edge_Plus_real # Samsung Galaxy S6 Edge+ - api 23 (6.0.1)
63-
# - id: Samsung_Tab_E_real_us # Samsung Tab E - api 23 (6.0.1)
64-
# - id: Amazon_Kindle_Fire_HD_8_real_us # Amazon Kindle Fire HD 8 - api 22 (5.1.1)
47+
# At the time of writing (August, 13, 2025), the market share per android version is:
48+
# 15.0 = 26.75%, 14.0 = 19.5%, 13 = 15.95%
49+
# Using these 3 versions we cover 62.2% of all devices out there. Currently, this is enough for benchmarking scope
6550

6651
artifacts:
6752
download:

.sauce/sentry-uitest-android-ui.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@ espresso:
1818
testApp: ./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/androidTest/release/sentry-uitest-android-release-androidTest.apk
1919
suites:
2020

21-
- name: "Android 14 Ui test (api 34)"
21+
- name: "Android 15 Ui test (api 35)"
2222
testOptions:
2323
clearPackageData: true
2424
useTestOrchestrator: true
2525
devices:
2626
- name: ".*"
27-
platformVersion: "14"
27+
platformVersion: "15"
2828

29-
- name: "Android 13 Ui test (api 33)"
29+
- name: "Android 14 Ui test (api 34)"
3030
testOptions:
3131
clearPackageData: true
3232
useTestOrchestrator: true
3333
devices:
3434
- name: ".*"
35-
platformVersion: "13"
35+
platformVersion: "14"
3636

37-
- name: "Android 11 Ui test (api 31)"
37+
- name: "Android 13 Ui test (api 33)"
3838
testOptions:
3939
clearPackageData: true
4040
useTestOrchestrator: true
4141
devices:
4242
- name: ".*"
43-
platformVersion: "11"
43+
platformVersion: "13"
4444

4545
# Controls what artifacts to fetch when the suite on Sauce Cloud has finished.
4646
artifacts:

gradle/libs.versions.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit
130130
retrofit-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
131131
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.10.0" }
132132
servlet-api = { module = "javax.servlet:javax.servlet-api", version = "3.1.0" }
133-
servlet-jakarta-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "5.0.0" }
133+
servlet-jakarta-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "6.1.0" }
134134
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
135135
slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }
136136
slf4j2-api = { module = "org.slf4j:slf4j-api", version = "2.0.5" }
@@ -174,6 +174,10 @@ springboot4-starter-jdbc = { module = "org.springframework.boot:spring-boot-star
174174
springboot4-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot4" }
175175
timber = { module = "com.jakewharton.timber:timber", version = "4.7.1" }
176176

177+
# tomcat libraries
178+
tomcat-catalina-jakarta = { module = "org.apache.tomcat:tomcat-catalina", version = "11.0.10" }
179+
tomcat-embed-jasper-jakarta = { module = "org.apache.tomcat.embed:tomcat-embed-jasper", version = "11.0.10" }
180+
177181
# test libraries
178182
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version = "1.6.8" }
179183
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" }

sentry-android-integration-tests/sentry-uitest-android-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ class SentryBenchmarkTest : BaseBenchmarkTest() {
101101
benchmarkOperationProfiled,
102102
"ProfiledTransaction",
103103
refreshRate,
104+
measuredIterations = 40,
104105
)
105106
comparisonResults.printAllRuns("Profiling Benchmark")
106107
val comparisonResult = comparisonResults.getSummaryResult()
107108
comparisonResult.printResults()
108109

109110
// Currently we just want to assert the cpu overhead
110111
assertTrue(
111-
comparisonResult.cpuTimeIncreasePercentage in 0F..5F,
112-
"Expected ${comparisonResult.cpuTimeIncreasePercentage} to be in range 0 < x < 5",
112+
comparisonResult.cpuTimeIncreasePercentage in 0F..5.5F,
113+
"Expected ${comparisonResult.cpuTimeIncreasePercentage} to be in range 0 < x < 5.5",
113114
)
114115
}
115116

sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
import org.springframework.boot.gradle.plugin.SpringBootPlugin
44

55
plugins {
6+
application
67
alias(libs.plugins.springboot3) apply false
78
alias(libs.plugins.spring.dependency.management)
89
alias(libs.plugins.kotlin.jvm)
@@ -11,6 +12,11 @@ plugins {
1112
alias(libs.plugins.gretty)
1213
}
1314

15+
application { mainClass.set("io.sentry.samples.spring.jakarta.Main") }
16+
17+
// Ensure WAR is up to date before run task
18+
tasks.named("run") { dependsOn(tasks.named("war")) }
19+
1420
group = "io.sentry.sample.spring-jakarta"
1521

1622
version = "0.0.1-SNAPSHOT"
@@ -37,16 +43,43 @@ dependencies {
3743
implementation(libs.logback.classic)
3844
implementation(libs.servlet.jakarta.api)
3945
implementation(libs.slf4j2.api)
46+
47+
implementation(libs.tomcat.catalina.jakarta)
48+
implementation(libs.tomcat.embed.jasper.jakarta)
49+
50+
testImplementation(projects.sentrySystemTestSupport)
51+
testImplementation(libs.kotlin.test.junit)
4052
testImplementation(libs.springboot.starter.test) {
4153
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
4254
}
4355
}
4456

45-
tasks.withType<Test>().configureEach { useJUnitPlatform() }
46-
4757
tasks.withType<KotlinCompile>().configureEach {
4858
kotlin {
4959
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
5060
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
5161
}
5262
}
63+
64+
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
65+
66+
tasks.register<Test>("systemTest").configure {
67+
group = "verification"
68+
description = "Runs the System tests"
69+
70+
outputs.upToDateWhen { false }
71+
72+
maxParallelForks = 1
73+
74+
// Cap JVM args per test
75+
minHeapSize = "128m"
76+
maxHeapSize = "1g"
77+
78+
filter { includeTestsMatching("io.sentry.systemtest*") }
79+
}
80+
81+
tasks.named("test").configure {
82+
require(this is Test)
83+
84+
filter { excludeTestsMatching("io.sentry.systemtest.*") }
85+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package io.sentry.samples.spring.jakarta;
2+
3+
import java.io.File;
4+
import java.io.IOException;
5+
import org.apache.catalina.LifecycleException;
6+
import org.apache.catalina.startup.Tomcat;
7+
8+
public class Main {
9+
10+
public static void main(String[] args) throws LifecycleException, IOException {
11+
File webappsDirectory = new File("./tomcat.8080/webapps");
12+
if (!webappsDirectory.exists()) {
13+
boolean didCreateDirectories = webappsDirectory.mkdirs();
14+
if (!didCreateDirectories) {
15+
throw new RuntimeException(
16+
"Failed to create directory required by Tomcat: " + webappsDirectory.getAbsolutePath());
17+
}
18+
}
19+
20+
String pathToWar = "./build/libs";
21+
String warName = "sentry-samples-spring-jakarta-0.0.1-SNAPSHOT";
22+
File war = new File(pathToWar + "/" + warName + ".war");
23+
24+
Tomcat tomcat = new Tomcat();
25+
tomcat.setPort(8080);
26+
tomcat.getConnector();
27+
28+
tomcat.addWebapp("/" + warName, war.getCanonicalPath());
29+
tomcat.start();
30+
tomcat.getServer().await();
31+
}
32+
}

sentry-samples/sentry-samples-spring-jakarta/src/main/java/io/sentry/samples/spring/jakarta/web/Person.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
package io.sentry.samples.spring.jakarta.web;
22

3+
import com.fasterxml.jackson.annotation.JsonCreator;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
36
public class Person {
47
private final String firstName;
58
private final String lastName;
69

7-
public Person(String firstName, String lastName) {
10+
@JsonCreator
11+
public Person(
12+
@JsonProperty("firstName") String firstName, @JsonProperty("lastName") String lastName) {
813
this.firstName = firstName;
914
this.lastName = lastName;
1015
}

0 commit comments

Comments
 (0)