Skip to content

Commit f15ffc6

Browse files
authored
Fix :plugins:repository-hdfs:forbiddenApisJavaRestTest (#102983) (#103036)
Reworking forbiddenApis check to use gradle worker api exposed a bug in how we resolve krb5kdc keytab information. This fixes the depenendency to krb5kdc keytab configuration and its builtBy task. This also changes the usage of krb5kdc keytab files to be passed directly to task classpath as they are only required at runtime and directly having them as part of javaRestTestRuntimeOnly would mean precommit requires krb5kdc compose up which we definitely not want
1 parent 2240989 commit f15ffc6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

plugins/repository-hdfs/build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ dependencies {
5959
runtimeOnly "org.slf4j:slf4j-nop:${versions.slf4j}"
6060
// runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}") https://github.com/elastic/elasticsearch/issues/93714
6161

62-
// Set the keytab files in the classpath so that we can access them from test code without the security manager
63-
// freaking out.
64-
if (isEclipse == false) {
65-
javaRestTestRuntimeOnly project(path: ':test:fixtures:krb5kdc-fixture', configuration:'krb5KeytabsHdfsDir')
66-
}
67-
6862
krb5Keytabs project(path: ':test:fixtures:krb5kdc-fixture', configuration: 'krb5KeytabsHdfsDir')
6963
krb5Config project(path: ':test:fixtures:krb5kdc-fixture', configuration: 'krb5ConfHdfsFile')
7064
}
@@ -187,7 +181,11 @@ for (int hadoopVersion = minTestedHadoopVersion; hadoopVersion <= maxTestedHadoo
187181
}
188182
}
189183
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
190-
classpath = sourceSets.javaRestTest.runtimeClasspath + files(portsFileDir)
184+
// Set the keytab files in the classpath so that we can access them from test code without the security manager
185+
// freaking out.
186+
classpath = sourceSets.javaRestTest.runtimeClasspath +
187+
configurations.krb5Keytabs +
188+
files(portsFileDir)
191189
}
192190
}
193191

test/fixtures/krb5kdc-fixture/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ artifacts {
5252
builtBy("postProcessFixture")
5353
}
5454
krb5KeytabsHdfsDir(file("$testFixturesDir/shared/hdfs/keytabs/")) {
55-
builtBy("preProcessFixture")
55+
builtBy("postProcessFixture")
5656
}
5757
}

0 commit comments

Comments
 (0)