Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .cursor/rules/e2e_tests.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ jar; each module adds only the dependencies of its Spring Boot line. `AgentApp`
per test JVM in a child process, with `ChildJvmApp` and the agent jar passed through
`ChildJvmTestArguments`. The suite's task runs with the agent initializing Sentry, and its second
target, `integrationTestOtelAgentWithoutAutoInit`, runs the same tests with the Spring Boot starter
doing it. Gradle runs the two in parallel. `otelAgentTests()` in a `springBootMatrix` block registers
doing it. Gradle runs the two in parallel. `otelAgentTests()` in a `jvmTestSuites` block registers
both on each version.

## Running them

- The `springBootMatrix` block in each Spring module's build file runs its suites on every version
of its Spring Boot line in `gradle/spring-boot-versions.json`, with a task per suite and version,
e.g. `integrationTestWebfluxBoot3_2_12`. The suites and the SDK compile once, against the
catalog's version; only the runtime classpath changes. `allIntegrationTestsBoot3_2_12` runs one
version's suites, `allIntegrationTestsBoot3` every version's.
- The `spring-boot-{2,3,4}-matrix.yml` workflows read the same file and run each version in its own
job, e.g. `./gradlew :sentry-spring-jakarta:allIntegrationTestsBoot3_2_12
:sentry-spring-boot-jakarta:allIntegrationTestsBoot3_2_12`. The suites aren't part of `check`, so
a new suite only runs on CI once it's added to its module's `springBootMatrix` block, and a new
module once it's added to its workflow.
- The `dependencyMatrix { jvmTestSuites(...) }` block in each Spring module's build file runs its
suites on every version of its Spring Boot line in `gradle/spring-boot-{2,3,4}-versions.json`,
with a task per suite and version, e.g. `integrationTestWebfluxSpringBoot3_2_12`. The suites and
the SDK compile once, against the catalog's version; only the runtime classpath changes.
`springBootTest3_2_12` runs one version's suites, `springBootTest` every version's, one version
at a time.
- The `spring-boot-{2,3,4}-matrix.yml` workflows run every version in one job, e.g. `./gradlew
:sentry-spring-jakarta:springBootTest :sentry-spring-boot-jakarta:springBootTest --continue`. The
suites aren't part of `check`, so a new suite only runs on CI once it's added to its module's
`jvmTestSuites` block, and a new module once it's added to its workflow.
- Suite code may only use APIs that exist in the oldest version of its line. Compiled against a
newer one, a missing API fails at runtime with `NoSuchMethodError` or `NoClassDefFoundError`.

Expand Down
37 changes: 6 additions & 31 deletions .github/workflows/spring-boot-2-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@ concurrency:
cancel-in-progress: true

jobs:
versions:
runs-on: ubuntu-latest
name: Spring Boot 2.x versions
outputs:
versions: ${{ steps.versions.outputs.versions }}

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: gradle

- name: Read Spring Boot 2.x versions
id: versions
run: echo "versions=$(jq -c .boot2 gradle/spring-boot-versions.json)" >> "$GITHUB_OUTPUT"

spring-boot-2-matrix:
needs: versions
timeout-minutes: 45
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.versions.outputs.versions) }}

name: Spring Boot ${{ matrix.springboot-version }}
name: Spring Boot 2.x

steps:
- name: Checkout Repo
Expand All @@ -54,19 +32,16 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1

# Runs every version in gradle/spring-boot-2-versions.json; --continue reports each failing
# one. Project paths, unlike a bare task name, keep Gradle from configuring every project.
- name: Test integration suites
# Project paths, unlike a bare task name, keep Gradle from configuring every project.
run: |
task="allIntegrationTestsBoot${SPRINGBOOT_VERSION//./_}"
./gradlew ":sentry-spring:$task" ":sentry-spring-boot:$task"
env:
SPRINGBOOT_VERSION: ${{ matrix.springboot-version }}
run: ./gradlew :sentry-spring:springBootTest :sentry-spring-boot:springBootTest --continue

- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: test-results-springboot-2-${{ matrix.springboot-version }}
name: test-results-springboot-2
path: |
**/build/reports/*
**/build/test-results/**/*.xml
Expand All @@ -75,7 +50,7 @@ jobs:
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Spring Boot 2.x ${{ matrix.springboot-version }}
name: JUnit Spring Boot 2.x
path: |
**/build/test-results/**/*.xml
reporter: java-junit
Expand Down
37 changes: 6 additions & 31 deletions .github/workflows/spring-boot-3-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@ concurrency:
cancel-in-progress: true

jobs:
versions:
runs-on: ubuntu-latest
name: Spring Boot 3.x versions
outputs:
versions: ${{ steps.versions.outputs.versions }}

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: gradle

- name: Read Spring Boot 3.x versions
id: versions
run: echo "versions=$(jq -c .boot3 gradle/spring-boot-versions.json)" >> "$GITHUB_OUTPUT"

spring-boot-3-matrix:
needs: versions
timeout-minutes: 45
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.versions.outputs.versions) }}

name: Spring Boot ${{ matrix.springboot-version }}
name: Spring Boot 3.x

steps:
- name: Checkout Repo
Expand All @@ -54,19 +32,16 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1

# Runs every version in gradle/spring-boot-3-versions.json; --continue reports each failing
# one. Project paths, unlike a bare task name, keep Gradle from configuring every project.
- name: Test integration suites
# Project paths, unlike a bare task name, keep Gradle from configuring every project.
run: |
task="allIntegrationTestsBoot${SPRINGBOOT_VERSION//./_}"
./gradlew ":sentry-spring-jakarta:$task" ":sentry-spring-boot-jakarta:$task"
env:
SPRINGBOOT_VERSION: ${{ matrix.springboot-version }}
run: ./gradlew :sentry-spring-jakarta:springBootTest :sentry-spring-boot-jakarta:springBootTest --continue
Comment thread
sentry-junior[bot] marked this conversation as resolved.
Resolved

- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: test-results-springboot-3-${{ matrix.springboot-version }}
name: test-results-springboot-3
path: |
**/build/reports/*
**/build/test-results/**/*.xml
Expand All @@ -75,7 +50,7 @@ jobs:
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Spring Boot 3.x ${{ matrix.springboot-version }}
name: JUnit Spring Boot 3.x
path: |
**/build/test-results/**/*.xml
reporter: java-junit
Expand Down
37 changes: 6 additions & 31 deletions .github/workflows/spring-boot-4-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@ concurrency:
cancel-in-progress: true

jobs:
versions:
runs-on: ubuntu-latest
name: Spring Boot 4.x versions
outputs:
versions: ${{ steps.versions.outputs.versions }}

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: gradle

- name: Read Spring Boot 4.x versions
id: versions
run: echo "versions=$(jq -c .boot4 gradle/spring-boot-versions.json)" >> "$GITHUB_OUTPUT"

spring-boot-4-matrix:
needs: versions
timeout-minutes: 45
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
springboot-version: ${{ fromJSON(needs.versions.outputs.versions) }}

name: Spring Boot ${{ matrix.springboot-version }}
name: Spring Boot 4.x

steps:
- name: Checkout Repo
Expand All @@ -54,19 +32,16 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1

# Runs every version in gradle/spring-boot-4-versions.json; --continue reports each failing
# one. Project paths, unlike a bare task name, keep Gradle from configuring every project.
- name: Test integration suites
# Project paths, unlike a bare task name, keep Gradle from configuring every project.
run: |
task="allIntegrationTestsBoot${SPRINGBOOT_VERSION//./_}"
./gradlew ":sentry-spring-7:$task" ":sentry-spring-boot-4:$task"
env:
SPRINGBOOT_VERSION: ${{ matrix.springboot-version }}
run: ./gradlew :sentry-spring-7:springBootTest :sentry-spring-boot-4:springBootTest --continue

- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: test-results-springboot-4-${{ matrix.springboot-version }}
name: test-results-springboot-4
path: |
**/build/reports/*
**/build/test-results/**/*.xml
Expand All @@ -75,7 +50,7 @@ jobs:
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Spring Boot 4.x ${{ matrix.springboot-version }}
name: JUnit Spring Boot 4.x
path: |
**/build/test-results/**/*.xml
reporter: java-junit
Expand Down
4 changes: 0 additions & 4 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ gradlePlugin {
id = "io.sentry.robolectric"
implementationClass = "io.sentry.gradle.SentryRobolectricPlugin"
}
register("sentrySpringBootMatrix") {
id = "io.sentry.spring-boot-matrix"
implementationClass = "io.sentry.gradle.SpringBootMatrixPlugin"
}
register("sentryDependencyMatrix") {
id = "io.sentry.dependency-matrix"
implementationClass = "io.sentry.gradle.DependencyMatrixPlugin"
Expand Down
Loading
Loading