diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java index ab86ddf800185..23be7c41425f6 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java @@ -46,6 +46,7 @@ import org.gradle.api.plugins.ExtraPropertiesExtension; import org.gradle.api.plugins.JavaBasePlugin; import org.gradle.api.provider.Provider; +import org.gradle.api.specs.Specs; import org.gradle.api.tasks.Copy; import org.gradle.api.tasks.TaskInputs; import org.gradle.api.tasks.TaskProvider; @@ -325,6 +326,7 @@ private static TaskProvider configureVMWrapperTask( private static TaskProvider configureDistroTest(Project project, ElasticsearchDistribution distribution) { return project.getTasks().register(destructiveDistroTestTaskName(distribution), Test.class, t -> { + t.getOutputs().doNotCacheIf("Build cache is disabled for packaging tests", Specs.satisfyAll()); t.setMaxParallelForks(1); t.setWorkingDir(project.getProjectDir()); t.systemProperty(DISTRIBUTION_SYSPROP, distribution.toString()); diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index 9ef1cc3958451..f9d12ce242da8 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -137,6 +137,7 @@ processTestResources { } task integTest(type: Test) { + outputs.doNotCacheIf('Build cache is disabled for Docker tests') { true } maxParallelForks = '1' include '**/*IT.class' // don't add the tasks to build the docker images if we have no way of testing them