Repository navigation
Cache the downloads of the Gradle plugins' TestKit builds - #291
Merged
Merged
Conversation
The TestKit builds of the Gradle plugins' tests have a Gradle user home of their own, under build/tmp/test/work by default, which CI's cache does not reach. Every job that runs those tests downloaded the Android Gradle plugin and its dependencies, about 127 MB, from Maven Central again: eight jobs a push, and on 2026-11-28 two pushes three minutes apart got 429 Too Many Requests from Maven Central. -PtestkitDir now sets that home. CI points it at test-kit in the Gradle user home and adds test-kit/caches/modules-2 to the paths setup-gradle caches. Locally the default stays: one directory for every checkout would be shared by tests that delete from it. MultiProjectTest's library with variants is looked for in its own repository only. The root project asked Maven Central for it first, which failed that test on a 429 as well.
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.
Before this PR
The Gradle plugins' tests build their projects with TestKit, and those builds have a Gradle user home of their own, under
gradle-open-java-format/build/tmp/test/work/.gradle-test-kitby default. setup-gradle caches~/.gradleonly, so every job that runs the tests (build, threebuild (JDK …)legs, fournative (…)jobs) downloaded the Android Gradle plugin and its dependencies, about 127 MB, from Maven Central again. On 2026-11-28 the merges of #289 and #290 three minutes apart started sixteen such jobs, and Maven Central answered429 Too Many Requests:native (ubuntu-24.04)failed 16 AndroidTest and 2 MultiProjectTest cases.After this PR
-PtestkitDirsets the TestKit builds' Gradle user home, throughorg.gradle.testkit.dir. CI passes$GRADLE_USER_HOME/test-kitin the three jobs that run the plugins' tests, and every setup-gradle step addstest-kit/caches/modules-2to the paths it caches, next to the defaultcachesandnotifications. Only the downloads go in; the transforms and generated jars of those builds, about 340 MB, are made on the runner as before.exclusiveContent. The root project asked Maven Central fortest:variants:1.0first, which failed that test on a 429 too.Checked locally: AndroidTest (16) and MultiProjectTest (10) pass with
-PtestkitDirpointing at an empty directory, the downloads land there, and the default directory is not created. The cache itself is written by builds of21.X.Xonly, so it fills on the first push after the merge and is read from the run after that.Possible downsides?
setup-gradle most likely does not deduplicate a nested
modules-2: its extraction patterns start at the root of the Gradle user home. The 127 MB would then go into each job's own entry, about 10 MB today, so roughly 1.1 GB of the repository's 10 GB for the eight jobs; the job summary shows the sizes after the first run on21.X.X. If that is too much, a separateactions/cacheentry per OS for the directory would hold one copy.