From 8bb5a11e7626d41af85661cbeeb669d3f1328314 Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Thu, 27 Feb 2020 09:53:33 -0800 Subject: [PATCH] Fix cacheability of repository-hdfs integ tests (#52858) --- plugins/repository-hdfs/build.gradle | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 543836165a4cc..83e3735300a0f 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -79,7 +79,7 @@ normalization { // ignore generated keytab files for the purposes of build avoidance ignore '*.keytab' // ignore fixture ports file which is on the classpath primarily to pacify the security manager - ignore '*HdfsFixture/**' + ignore 'ports' } } @@ -152,20 +152,29 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec runner { onlyIf { BuildParams.inFipsJvm == false } if (integTestTaskName.contains("Ha")) { + Path portsFile + File portsFileDir = file("${workingDir}/hdfsFixture") if (integTestTaskName.contains("Secure")) { - Path path = buildDir.toPath() + portsFile = buildDir.toPath() .resolve("fixtures") .resolve("secureHaHdfsFixture") .resolve("ports") - nonInputProperties.systemProperty "test.hdfs-fixture.ports", path } else { - Path path = buildDir.toPath() + portsFile = buildDir.toPath() .resolve("fixtures") .resolve("haHdfsFixture") .resolve("ports") - nonInputProperties.systemProperty "test.hdfs-fixture.ports", path } - classpath += files("$buildDir/fixtures") + nonInputProperties.systemProperty "test.hdfs-fixture.ports", file("$portsFileDir/ports") + classpath += files(portsFileDir) + // Copy ports file to separate location which is placed on the test classpath + doFirst { + mkdir(portsFileDir) + copy { + from portsFile + into portsFileDir + } + } } if (integTestTaskName.contains("Secure")) {