Skip to content

Commit 8bb5a11

Browse files
authored
Fix cacheability of repository-hdfs integ tests (#52858)
1 parent d7a6333 commit 8bb5a11

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

plugins/repository-hdfs/build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ normalization {
7979
// ignore generated keytab files for the purposes of build avoidance
8080
ignore '*.keytab'
8181
// ignore fixture ports file which is on the classpath primarily to pacify the security manager
82-
ignore '*HdfsFixture/**'
82+
ignore 'ports'
8383
}
8484
}
8585

@@ -152,20 +152,29 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec
152152
runner {
153153
onlyIf { BuildParams.inFipsJvm == false }
154154
if (integTestTaskName.contains("Ha")) {
155+
Path portsFile
156+
File portsFileDir = file("${workingDir}/hdfsFixture")
155157
if (integTestTaskName.contains("Secure")) {
156-
Path path = buildDir.toPath()
158+
portsFile = buildDir.toPath()
157159
.resolve("fixtures")
158160
.resolve("secureHaHdfsFixture")
159161
.resolve("ports")
160-
nonInputProperties.systemProperty "test.hdfs-fixture.ports", path
161162
} else {
162-
Path path = buildDir.toPath()
163+
portsFile = buildDir.toPath()
163164
.resolve("fixtures")
164165
.resolve("haHdfsFixture")
165166
.resolve("ports")
166-
nonInputProperties.systemProperty "test.hdfs-fixture.ports", path
167167
}
168-
classpath += files("$buildDir/fixtures")
168+
nonInputProperties.systemProperty "test.hdfs-fixture.ports", file("$portsFileDir/ports")
169+
classpath += files(portsFileDir)
170+
// Copy ports file to separate location which is placed on the test classpath
171+
doFirst {
172+
mkdir(portsFileDir)
173+
copy {
174+
from portsFile
175+
into portsFileDir
176+
}
177+
}
169178
}
170179

171180
if (integTestTaskName.contains("Secure")) {

0 commit comments

Comments
 (0)