Skip to content

Commit f634d01

Browse files
authored
Create Test Matrix for Spring Boot (#4741)
* Create Test Matrix for Spring Boot * caching * ignore android changes * Add missing otel samples / auto init false * add spring modules * fix used module * comment out spring boot 4 noagent for now
1 parent d478d66 commit f634d01

File tree

3 files changed

+529
-0
lines changed

3 files changed

+529
-0
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Spring Boot 2.x Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/sentry-android/**'
9+
pull_request:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
spring-boot-2-matrix:
17+
timeout-minutes: 45
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
springboot-version: [ '2.1.0', '2.2.5', '2.4.13', '2.5.15', '2.6.15', '2.7.0', '2.7.18' ]
23+
24+
name: Spring Boot ${{ matrix.springboot-version }}
25+
env:
26+
SENTRY_URL: http://127.0.0.1:8000
27+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
28+
29+
steps:
30+
- name: Checkout Repo
31+
uses: actions/checkout@v5
32+
with:
33+
submodules: 'recursive'
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v6
37+
with:
38+
python-version: '3.10.5'
39+
40+
- name: Install Python dependencies
41+
run: |
42+
python3 -m pip install --upgrade pip
43+
python3 -m pip install -r requirements.txt
44+
45+
- name: Set up Java
46+
uses: actions/setup-java@v5
47+
with:
48+
distribution: 'temurin'
49+
java-version: '17'
50+
51+
# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
52+
- name: Cache buildSrc
53+
uses: actions/cache@v4
54+
with:
55+
path: buildSrc/build
56+
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}
57+
58+
- name: Setup Gradle
59+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a
60+
with:
61+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
62+
63+
- name: Update Spring Boot 2.x version
64+
run: |
65+
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
66+
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
67+
68+
- name: Exclude android modules from build
69+
run: |
70+
sed -i \
71+
-e '/.*"sentry-android-ndk",/d' \
72+
-e '/.*"sentry-android",/d' \
73+
-e '/.*"sentry-compose",/d' \
74+
-e '/.*"sentry-android-core",/d' \
75+
-e '/.*"sentry-android-fragment",/d' \
76+
-e '/.*"sentry-android-navigation",/d' \
77+
-e '/.*"sentry-android-sqlite",/d' \
78+
-e '/.*"sentry-android-timber",/d' \
79+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
80+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
81+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
82+
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
83+
-e '/.*"sentry-samples:sentry-samples-android",/d' \
84+
-e '/.*"sentry-android-replay",/d' \
85+
settings.gradle.kts
86+
87+
- name: Exclude android modules from ignore list
88+
run: |
89+
sed -i \
90+
-e '/.*"sentry-uitest-android",/d' \
91+
-e '/.*"sentry-uitest-android-benchmark",/d' \
92+
-e '/.*"sentry-uitest-android-critical",/d' \
93+
-e '/.*"test-app-sentry",/d' \
94+
-e '/.*"sentry-samples-android",/d' \
95+
build.gradle.kts
96+
97+
- name: Build SDK
98+
run: |
99+
./gradlew assemble --parallel
100+
101+
- name: Test sentry-samples-spring-boot
102+
run: |
103+
python3 test/system-test-runner.py test \
104+
--module "sentry-samples-spring-boot" \
105+
--agent false \
106+
--auto-init "true" \
107+
--build "true"
108+
109+
- name: Test sentry-samples-spring-boot-webflux
110+
run: |
111+
python3 test/system-test-runner.py test \
112+
--module "sentry-samples-spring-boot-webflux" \
113+
--agent false \
114+
--auto-init "true" \
115+
--build "true"
116+
117+
- name: Test sentry-samples-spring-boot-opentelemetry agent init true
118+
run: |
119+
python3 test/system-test-runner.py test \
120+
--module "sentry-samples-spring-boot-opentelemetry" \
121+
--agent true \
122+
--auto-init "true" \
123+
--build "true"
124+
125+
- name: Test sentry-samples-spring-boot-opentelemetry agent init false
126+
run: |
127+
python3 test/system-test-runner.py test \
128+
--module "sentry-samples-spring-boot-opentelemetry" \
129+
--agent true \
130+
--auto-init "false" \
131+
--build "true"
132+
133+
- name: Test sentry-samples-spring-boot-opentelemetry-noagent
134+
run: |
135+
python3 test/system-test-runner.py test \
136+
--module "sentry-samples-spring-boot-opentelemetry-noagent" \
137+
--agent false \
138+
--auto-init "true" \
139+
--build "true"
140+
141+
- name: Test sentry-samples-spring
142+
run: |
143+
python3 test/system-test-runner.py test \
144+
--module "sentry-samples-spring" \
145+
--agent false \
146+
--auto-init "true" \
147+
--build "true"
148+
149+
- name: Upload test results
150+
if: always()
151+
uses: actions/upload-artifact@v4
152+
with:
153+
name: test-results-springboot-2-${{ matrix.springboot-version }}
154+
path: |
155+
**/build/reports/*
156+
**/build/test-results/**/*.xml
157+
sentry-mock-server.txt
158+
spring-server.txt
159+
160+
- name: Test Report
161+
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # pin@v15
162+
if: always()
163+
with:
164+
name: JUnit Spring Boot 2.x ${{ matrix.springboot-version }}
165+
path: |
166+
**/build/test-results/**/*.xml
167+
reporter: java-junit
168+
output-to: step-summary
169+
fail-on-error: false
170+
171+
- name: Upload test results to Codecov
172+
if: ${{ !cancelled() }}
173+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f
174+
with:
175+
token: ${{ secrets.CODECOV_TOKEN }}
176+
file: '**/build/test-results/**/*.xml'
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Spring Boot 3.x Matrix
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**/sentry-android/**'
9+
pull_request:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
spring-boot-3-matrix:
17+
timeout-minutes: 45
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
springboot-version: [ '3.0.0', '3.2.10', '3.3.5', '3.4.5', '3.5.6' ]
23+
24+
name: Spring Boot ${{ matrix.springboot-version }}
25+
env:
26+
SENTRY_URL: http://127.0.0.1:8000
27+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
28+
29+
steps:
30+
- name: Checkout Repo
31+
uses: actions/checkout@v5
32+
with:
33+
submodules: 'recursive'
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@v6
37+
with:
38+
python-version: '3.10.5'
39+
40+
- name: Install Python dependencies
41+
run: |
42+
python3 -m pip install --upgrade pip
43+
python3 -m pip install -r requirements.txt
44+
45+
- name: Set up Java
46+
uses: actions/setup-java@v5
47+
with:
48+
distribution: 'temurin'
49+
java-version: '17'
50+
51+
# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
52+
- name: Cache buildSrc
53+
uses: actions/cache@v4
54+
with:
55+
path: buildSrc/build
56+
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}
57+
58+
- name: Setup Gradle
59+
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a
60+
with:
61+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
62+
63+
- name: Update Spring Boot 3.x version
64+
run: |
65+
sed -i 's/^springboot3=.*/springboot3=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
66+
echo "Updated Spring Boot 3.x version to ${{ matrix.springboot-version }}"
67+
68+
- name: Exclude android modules from build
69+
run: |
70+
sed -i \
71+
-e '/.*"sentry-android-ndk",/d' \
72+
-e '/.*"sentry-android",/d' \
73+
-e '/.*"sentry-compose",/d' \
74+
-e '/.*"sentry-android-core",/d' \
75+
-e '/.*"sentry-android-fragment",/d' \
76+
-e '/.*"sentry-android-navigation",/d' \
77+
-e '/.*"sentry-android-sqlite",/d' \
78+
-e '/.*"sentry-android-timber",/d' \
79+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' \
80+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' \
81+
-e '/.*"sentry-android-integration-tests:sentry-uitest-android-critical",/d' \
82+
-e '/.*"sentry-android-integration-tests:test-app-sentry",/d' \
83+
-e '/.*"sentry-samples:sentry-samples-android",/d' \
84+
-e '/.*"sentry-android-replay",/d' \
85+
settings.gradle.kts
86+
87+
- name: Exclude android modules from ignore list
88+
run: |
89+
sed -i \
90+
-e '/.*"sentry-uitest-android",/d' \
91+
-e '/.*"sentry-uitest-android-benchmark",/d' \
92+
-e '/.*"sentry-uitest-android-critical",/d' \
93+
-e '/.*"test-app-sentry",/d' \
94+
-e '/.*"sentry-samples-android",/d' \
95+
build.gradle.kts
96+
97+
- name: Build SDK
98+
run: |
99+
./gradlew assemble --parallel
100+
101+
- name: Test sentry-samples-spring-boot-jakarta
102+
run: |
103+
python3 test/system-test-runner.py test \
104+
--module "sentry-samples-spring-boot-jakarta" \
105+
--agent false \
106+
--auto-init "true" \
107+
--build "true"
108+
109+
- name: Test sentry-samples-spring-boot-webflux-jakarta
110+
run: |
111+
python3 test/system-test-runner.py test \
112+
--module "sentry-samples-spring-boot-webflux-jakarta" \
113+
--agent false \
114+
--auto-init "true" \
115+
--build "true"
116+
117+
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init true
118+
run: |
119+
python3 test/system-test-runner.py test \
120+
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
121+
--agent true \
122+
--auto-init "true" \
123+
--build "true"
124+
125+
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init false
126+
run: |
127+
python3 test/system-test-runner.py test \
128+
--module "sentry-samples-spring-boot-jakarta-opentelemetry" \
129+
--agent true \
130+
--auto-init "false" \
131+
--build "true"
132+
133+
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry-noagent
134+
run: |
135+
python3 test/system-test-runner.py test \
136+
--module "sentry-samples-spring-boot-jakarta-opentelemetry-noagent" \
137+
--agent false \
138+
--auto-init "true" \
139+
--build "true"
140+
141+
- name: Test sentry-samples-spring-jakarta
142+
run: |
143+
python3 test/system-test-runner.py test \
144+
--module "sentry-samples-spring-jakarta" \
145+
--agent false \
146+
--auto-init "true" \
147+
--build "true"
148+
149+
- name: Upload test results
150+
if: always()
151+
uses: actions/upload-artifact@v4
152+
with:
153+
name: test-results-springboot-3-${{ matrix.springboot-version }}
154+
path: |
155+
**/build/reports/*
156+
**/build/test-results/**/*.xml
157+
sentry-mock-server.txt
158+
spring-server.txt
159+
160+
- name: Test Report
161+
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # pin@v15
162+
if: always()
163+
with:
164+
name: JUnit Spring Boot 3.x ${{ matrix.springboot-version }}
165+
path: |
166+
**/build/test-results/**/*.xml
167+
reporter: java-junit
168+
output-to: step-summary
169+
fail-on-error: false
170+
171+
- name: Upload test results to Codecov
172+
if: ${{ !cancelled() }}
173+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f
174+
with:
175+
token: ${{ secrets.CODECOV_TOKEN }}
176+
file: '**/build/test-results/**/*.xml'

0 commit comments

Comments
 (0)