Skip to content

Commit 679b3c9

Browse files
authored
Don't start docker fixtures when resolving test runtime classpath (#91476)
We have some test runtime resources that are generated by our Docker based test fixtures. These resources are then placed on the runtime test classpath to be used by the test classes themselves. The problem here is that any build that attempts to resolve the test runtime classpath will then trigger the starting of these Docker fixtures, which is quite expensive. Some of our precommit checks, like forbidden apis and third-party audit tasks do this. This commit decouples this a bit and removes the implicit dependency replacing it with an explicit one on the test task itself. It's slightly less idomatic Gradle, but it's a worthwhile optimization.
1 parent f85dfc7 commit 679b3c9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

x-pack/qa/saml-idp-tests/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'elasticsearch.internal-java-rest-test'
66
apply plugin: 'elasticsearch.test.fixtures'
77

88
dependencies {
9-
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
9+
javaRestTestImplementation testArtifact(project(xpackModule('core')))
1010
javaRestTestImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
1111
javaRestTestImplementation "com.google.guava:guava:${versions.jimfs_guava}"
1212
}
@@ -29,10 +29,8 @@ tasks.register("copyIdpFiles", Sync) {
2929
}
3030
}
3131

32-
project.sourceSets.javaRestTest.output.dir(outputDir, builtBy: [copyIdpFiles])
33-
3432
tasks.named("javaRestTest").configure {
35-
dependsOn tasks.named("copyIdpFiles")
33+
classpath += files(tasks.named("copyIdpFiles"))
3634
onlyIf { idpFixtureProject.postProcessFixture.state.skipped == false }
3735
}
3836

0 commit comments

Comments
 (0)