Test coverage: Verify configuration-cache is restored with project-dot-gradle

This commit is contained in:
Daz DeBoer 2021-08-27 06:36:29 -06:00
parent a587e93714
commit 436390bd4e
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
2 changed files with 11 additions and 31 deletions

View file

@ -11,6 +11,10 @@ dependencies {
}
tasks.named("test").configure {
// Use an environment variable to bypass config-cache checks
if (System.getenv('VERIFY_CACHED_CONFIGURATION') != null) {
throw new RuntimeException("Configuration was not cached: unexpected configuration of test task")
}
doLast {
if (System.properties.verifyCachedBuild) {
throw new RuntimeException("Build was not cached: unexpected execution of test task")