Repository navigation
Share one TestKit directory among modules for TestKit coverage - #831
Merged
Merged
Conversation
`enableTestKitCoverage()` now also passes the `io.spine.tools.gradle.testkit.coverage.home` system property, naming `caches/spine-testkit` under the Gradle user home. A `plugin-testlib` that reads it points the TestKit runners of all modules at that directory, which `setup-gradle` keeps between CI runs, instead of an empty `build/testkit-home` per module. An older `plugin-testlib` ignores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
8 of 9 tasks
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues are recorded for the change enabling shared TestKit caches across modules and CI runs.
No open issues 🎉
What changed in this PR
Updates enableTestKitCoverage() to let compatible plugin-testlib versions share a TestKit directory across modules, enabling reuse of worker-build caches locally and across CI runs.
Changes:
- Passes
io.spine.tools.gradle.testkit.coverage.hometo test JVMs, pointing tocaches/spine-testkitunder the Gradle user home. - Documents compatibility with older harness versions, cache persistence, and manual cleanup.
| File | Description |
|---|---|
buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt |
Adds the shared-directory system property and documents its behavior. |
Review effort: Balanced
This was referenced Nov 3, 2026
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.
Summary
enableTestKitCoverage()now also passesio.spine.tools.gradle.testkit.coverage.hometo the test JVM. The property namescaches/spine-testkitunder the Gradle user home, a TestKit directory shared by the worker builds of all modules.Why:
plugin-testlibharness gives each modulebuild/testkit-homeas the Gradle user home of its TestKit worker builds. On CI that directory is empty on every run, so the first worker build of each module downloads its dependencies and generates the Gradle API JARs again.gradle/actions/setup-gradlesaves and restorescaches/of the Gradle user home; our Windows logs showcache-includes: caches. A directory placed there is kept between runs, so a pull request run starts warm.The
plugin-testlibside, which reads the property and moves the JaCoCo agent from agradle.propertiesin the TestKit directory to the command line, is SpineEventEngine/tool-base#207.Compatibility: a
plugin-testlibversion that predates the property ignores it and keeps a per-module directory, so the two changes can land in either order.Measurements
Tests of the four TestKit modules of
tool-base, local, wall-clock:Kover line and branch totals of those modules are identical with shared and per-module homes. Without the TestKit data they drop sharply (
gradle-plugin-api: 13/14 lines down to 7/14), so the match shows that the worker coverage is still merged.Worth watching after merge
tool-base's worker builds. It goes into the main Gradle-home cache entry of each OS job. The repo currently uses 4.85 of 10 GB.masterfor a lock timeout.cleanreset: the directory lives outsidebuild/. Delete~/.gradle/caches/spine-testkitto start from an empty one; the KDoc says so.Test plan
./gradlew :buildSrc:build detekttool-base, with thisbuildSrcand the newplugin-testlib: tests pass, and Kover totals match per-module homes.gradle-review,kotlin-engineer,review-docs. All approved; their doc findings are applied.tool-base: a Windows PR run restores the shared directory, and its test time drops.🤖 Generated with Claude Code