build(samples): Remove outputs.upToDateWhen { false } from systemTest tasks#5522
Merged
Conversation
… tasks The systemTest tasks in the sample modules forced Gradle to always treat their outputs as out of date, disabling up-to-date checks and build cache reuse. Removing this lets Gradle rely on its normal input/output tracking for the Test tasks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
adinauer
approved these changes
Jun 10, 2026
adinauer
left a comment
Member
There was a problem hiding this comment.
Nice work! Thanks! Approving so you can merge once the comment is addressed.
9724cf1 to
e1d4454
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e1d4454. Configure here.
The system tests launch the packaged sample (war/shadowJar/bootJar) from
build/libs as a separate process, so the archive is a real input to the
systemTest task even though it is not on the test classpath. Without it,
removing outputs.upToDateWhen { false } would let Gradle mark systemTest
up-to-date while a separate jar build refreshed the artifact, skipping
verification against the rebuilt sample.
Move that wiring into a single io.sentry.systemtest convention plugin in
build-logic instead of repeating it in every sample build file. The
plugin auto-detects the packaging task (war, else shadowJar, else
bootJar), mirroring the selection in test/system-test-runner.py, and
declares its archive as an input and dependency. Each sample just
applies the plugin.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e1d4454 to
1357435
Compare
The agent-based OpenTelemetry samples are launched by the runner with -javaagent:<sentry-opentelemetry-agent>, started outside the test JVM. That jar is not on the test classpath nor one of the app archives, so without tracking it systemTest could stay up-to-date and be skipped while the runner launches a newer agent. Add a usesOpenTelemetryAgent opt-in to the io.sentry.systemtest plugin; the three agent samples enable it and the agent jar is then tracked as a content input. The runner already builds and launches the agent before invoking the task, so it is tracked by path without a cross-project task dependency, which keeps it configuration-on-demand and configuration cache compatible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e0dbf30 to
06b56f2
Compare
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 18c0bc2 | 306.73 ms | 349.77 ms | 43.03 ms |
| 0eaac1e | 316.82 ms | 357.34 ms | 40.52 ms |
| d15471f | 303.49 ms | 439.08 ms | 135.59 ms |
| fc5ccaf | 276.52 ms | 370.46 ms | 93.93 ms |
| e2dce0b | 308.96 ms | 360.10 ms | 51.14 ms |
| 5b1a06b | 352.27 ms | 413.70 ms | 61.43 ms |
| 37ec571 | 366.04 ms | 424.28 ms | 58.23 ms |
| 9fbb112 | 361.43 ms | 427.57 ms | 66.14 ms |
| bbc35bb | 324.88 ms | 425.73 ms | 100.85 ms |
| ff8eea4 | 313.42 ms | 337.08 ms | 23.66 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 18c0bc2 | 1.58 MiB | 2.13 MiB | 557.33 KiB |
| 0eaac1e | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
| e2dce0b | 0 B | 0 B | 0 B |
| 5b1a06b | 0 B | 0 B | 0 B |
| 37ec571 | 0 B | 0 B | 0 B |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| bbc35bb | 1.58 MiB | 2.12 MiB | 553.01 KiB |
| ff8eea4 | 1.58 MiB | 2.28 MiB | 718.64 KiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📜 Description
Removes
outputs.upToDateWhen { false }from thesystemTesttasks in thesentry-samples/*modules and replaces it with proper Gradle input tracking via a newio.sentry.systemtestconvention plugin.The system tests launch the packaged sample app (
shadowJar/bootJar/war) frombuild/libsas a separate process — it is not on the test classpath. With onlyoutputs.upToDateWhen { false }removed, Gradle would compute up-to-date purely from the test classes and runtime classpath, so a separate jar build could refresh the artifact whilesystemTestwas skipped, meaning the assertions never ran against the rebuilt sample.Rather than repeat the wiring in all 22 sample build files, it lives in one
build-logicconvention plugin (build-logic/src/main/kotlin/io.sentry.systemtest.gradle.kts), following the existingio.sentry.spotless/io.sentry.javadocpattern. Each sample appliesid("io.sentry.systemtest"). The plugin auto-detects the packaging task with precedence war → shadowJar → bootJar (mirroringtest/system-test-runner.py) and declares its archive as asystemTestinput:tasks.matching { it.name == "systemTest" }.configureEach { val archiveTask = listOf("war", "shadowJar", "bootJar").firstOrNull { it in tasks.names } ?: throw GradleException("…none of war/shadowJar/bootJar exist…") // Declaring the archive as an input also wires the dependency on its producing task. inputs.files(tasks.named(archiveTask)) .withPropertyName("appArchive") .withNormalizer(ClasspathNormalizer::class.java) … }OpenTelemetry agent. The agent-based OTel samples are also launched with
-javaagent:<sentry-opentelemetry-agent>, started outside the test JVM and likewise untracked. The plugin exposes ausesOpenTelemetryAgentopt-in (sentrySystemTest { usesOpenTelemetryAgent = true }); the three agent samples enable it and the agent jar is tracked as a content input. The runner already builds and launches the agent before invoking the task, so it is tracked by path (no cross-project task dependency), which keeps it configuration-on-demand and configuration-cache compatible.Notes on Gradle best practices:
tasks.matching { … }.configureEach+it in tasks.names+tasks.named(…)are all lazy — no eager task realization (configuration avoidance preserved).afterEvaluate.GradleException) rather than silently skipping the input.💡 Motivation and Context
outputs.upToDateWhen { false }disabled up-to-date checks and build-cache reuse for thesystemTesttasks because the launched JAR/WAR (and OTel agent) were not modeled as task inputs. This models those inputs properly — in one place — instead of disabling incremental builds wholesale.💚 How did you test it?
./gradlew spotlessApply/spotlessCheckpass; the convention plugin compiles and applies../gradlew --dry-run --configuration-cache :sentry-samples:<module>:systemTestfor a console (shadowJar), Spring Boot 2 (shadowJar), Spring Boot 4 (bootJar), and Tomcat (war) module confirms the packaging task is wired ahead ofsystemTest; agent modules additionally track the agent jar. Configuration cache stores and reuses cleanly.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog