The --build-cache is working for unit tests but not for integration tests. I’ve ran one test several times and compared the cache hashes by using a diff tool, all the cache hashes are the same on every attempt.
16 actionable tasks: 11 executed, 4 from cache, 1 up-to-date
> Task :backend-api:integrationTest
...
Appending input file fingerprints for 'testFrameworkProperty.options.suiteXmlFiles' to build cache key: 5fd1e7396e8de4cb5c23dc6aadd7787a - IGNORED_PATH{EMPTY}
Appending output property name to build cache key: binaryResultsDirectory
Appending output property name to build cache key: jvmArgumentProviders.jacocoAgent$0.jacoco.destinationFile
Appending output property name to build cache key: options.outputDirectory
Appending output property name to build cache key: reports.enabledReports.html.outputLocation
Appending output property name to build cache key: reports.enabledReports.junitXml.outputLocation
Appending output property name to build cache key: testFrameworkProperty.options.outputDirectory
Build cache key for task ':backend-api:integrationTest' is aede07664fdd30efd89605cb823d8b21
It seems to build the cache properly - could someone please help me understand why the consequent tests are not picking up the cache?
@Vampire
I’ve ran in --debug and obtained a bit more of info:
2022-11-16T16:21:50.287+0100 [WARN] [org.gradle.internal.execution.steps.ResolveCachingStateStep] Build cache key for task ':backend-api:integrationTest' is 154ec4e746e42ce2572c40a437b570d8
2022-11-16T16:21:50.289+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot task inputs for :backend-api:integrationTest' completed
2022-11-16T16:21:50.289+0100 [DEBUG] [org.gradle.internal.execution.steps.SkipUpToDateStep] Determining if task ':backend-api:integrationTest' is up-to-date
2022-11-16T16:21:50.289+0100 [INFO] [org.gradle.internal.execution.steps.SkipUpToDateStep] Task ':backend-api:integrationTest' is not up-to-date because:
Task.upToDateWhen is false.
2022-11-16T16:21:50.290+0100 [DEBUG] [org.gradle.internal.execution.steps.BuildCacheStep] Did not find cache entry for task ':backend-api:integrationTest' with cache key 154ec4e746e42ce2572c40a437b570d8, executing instead