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
58 changes: 52 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: Build Job ubuntu-latest - Java 17
test:
name: Test
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -41,8 +41,16 @@ jobs:
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

- name: Run Tests with coverage and Lint
run: make preMerge
- name: Run Tests
run: >
./gradlew
test
testReleaseUnitTest
jacocoTestReport
koverXmlReportRelease
-x :sentry-spring-boot:test
-x :sentry-spring-boot-jakarta:test
-x :sentry-spring-boot-4:test
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spring Boot module unit tests excluded from CI

High Severity

The test job explicitly excludes unit tests for :sentry-spring-boot, :sentry-spring-boot-jakarta, and :sentry-spring-boot-4 via -x flags. Previously, make preMerge ran ./gradlew check which included all module tests. The Spring Boot matrix workflows only run system tests (Python-based), not these Gradle unit tests, so these unit tests are no longer executed anywhere in CI.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 72134fd. Configure here.


- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # pin@v4
Expand All @@ -55,19 +63,57 @@ jobs:
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: test-results-build
name: test-results-test
path: |
**/build/reports/*

- name: Test Report
uses: phoenix-actions/test-reporting@f957cd93fc2d848d556fa0d03c57bc79127b6b5e # pin@v15
if: always()
with:
name: JUnit Build
name: JUnit Test
list-suites: 'failed'
list-tests: 'failed'
path: |
**/build/test-results/**/*.xml
reporter: java-junit
output-to: step-summary
fail-on-error: false

lint:
name: Lint
runs-on: ubuntu-latest

env:
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
submodules: 'recursive'

- name: Setup Java Version
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'temurin'
java-version: '17'

# Workaround for https://github.com/gradle/actions/issues/21 to use config cache
- name: Cache buildSrc
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: buildSrc/build
key: build-logic-${{ hashFiles('buildSrc/src/**', 'buildSrc/build.gradle.kts','buildSrc/settings.gradle.kts') }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

- name: Run Lint
run: >
./gradlew
apiCheck
animalsnifferMain
lint
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI lint job missing detekt static analysis checks

Medium Severity

The new lint job only runs apiCheck, animalsnifferMain, and lint. The old workflow ran ./gradlew check which also executed detekt (configured in build.gradle.kts with custom rules from detekt.yml). The detekt static analysis is no longer run in CI, allowing code quality regressions to pass undetected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 72134fd. Configure here.

11 changes: 7 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ allprojects {
TestLogEvent.PASSED,
TestLogEvent.FAILED
)

// Cap JVM args per test
minHeapSize = "256m"
maxHeapSize = "2g"
// Cap JVM args per test
minHeapSize = "256m"
maxHeapSize = "1g"
}
withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing", "-Xlint:-try"))
Expand Down Expand Up @@ -141,6 +140,10 @@ subprojects {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}

// Cap JVM args per test
minHeapSize = "256m"
maxHeapSize = "1g"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ tasks.withType<JavaCompile>().configureEach {
}
}

tasks.withType<Test>().configureEach {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty no-op test configuration block is dead code

Low Severity

tasks.withType<Test>().configureEach {} is an empty configuration block that has no effect. It likely was intended to contain heap size settings (like the similar blocks added to sentry-android-replay and sentry-spring-boot), but was left empty. The allprojects block in the root build.gradle.kts already configures heap sizes for all test tasks, so this block is redundant dead code.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d89823c. Configure here.


dependencies {
api(projects.sentry)
compileOnly(libs.jetbrains.annotations)
Expand Down
6 changes: 6 additions & 0 deletions sentry-android-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@ tasks.withType<Detekt>().configureEach {
tasks.withType<KotlinCompilationTask<*>>().configureEach {
compilerOptions.freeCompilerArgs.add("-opt-in=androidx.compose.ui.ExperimentalComposeUiApi")
}

tasks.withType<Test>().configureEach {
// Cap JVM args per test
minHeapSize = "256m"
maxHeapSize = "1g"
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-console-otlp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-console/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System tests lose sequential execution guarantee

Medium Severity

maxParallelForks = 1 was removed from all system test task configurations across ~20 sample modules. System tests interact with real servers and shared resources like network ports. Without this constraint, Gradle may fork multiple test processes in parallel (default is based on CPU count), causing port conflicts and flaky test failures. This change is unrelated to the Develocity plugin and appears accidental.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0d72252. Configure here.

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-jul/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-log4j2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-logback/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
6 changes: 0 additions & 6 deletions sentry-samples/sentry-samples-spring-7/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,10 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

tasks.named("test").configure {
tasks.named<Test>("test").configure {
require(this is Test)

filter { excludeTestsMatching("io.sentry.systemtest.*") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,7 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

tasks.named("test").configure {
require(this is Test)

filter { excludeTestsMatching("io.sentry.systemtest.*") }
}
tasks.named<Test>("test").configure { filter { excludeTestsMatching("io.sentry.systemtest.*") } }
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ tasks.register<Test>("systemTest").configure {

outputs.upToDateWhen { false }

maxParallelForks = 1

// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"

filter { includeTestsMatching("io.sentry.systemtest*") }
}

Expand Down
Loading
Loading