I use testkit to verify our gradle build file, but I will now have to run this on a machine that does not have internet access. For regular gradle builds, I can force a download of dependencies and plugins to a shared disk before I move to the machine without connectivity and use that directory as GRADLE_USER_HOME.
But for testkit, this doesn’t work at all, and I think I found the reason here: https://docs.gradle.org/current/userguide/test_kit.html
The runner executes the test builds in an isolated environment by specifying a dedicated “working directory” in a directory inside the JVM’s temp directory (i.e. the location specified by the
java.io.tmpdir system property, typically
/tmp ). Any configuration in the default Gradle user home directory (e.g.
~/.gradle/gradle.properties ) is not used for test execution. The TestKit does not expose a mechanism for fine grained control of environment variables etc
So whatever I set as GRADLE_USER_HOME will be ignored and it will attempt to fetch dependencies to a directory under /tmp, so as far as I can tell, it won’t be possible to run any Test Kit builds without internet access. Since it works towards /tmp, I can’t force a download to the shared disk (and I don’t know which machine it will execute on) so I don’t have much of a workaround there either.
Is the above documentation up-to-date so that there is no way to override which GRADLE_USER_HOME to use with testkit?