Ensure more gradle tasks using task avoidance API

Release Manager builds were failing as `downloadEs` task was being
needlessly run during `rake artifact:all` task. When run with
`RELEASE=1`. this was causing build failures due to the non-availability
of Elasticsearch release artifacts. This commit aims to avoid running
the `downloadES` task when it is not needed, continuing the work done
in #11914

This commit also removes code that was repeated in different parts of
the build script.
This commit is contained in:
Rob Bavey 2020-07-13 14:41:38 -04:00 committed by Robert Bavey
parent 8e750ccd08
commit b2c652bf9d
2 changed files with 9 additions and 13 deletions

View file

@ -450,12 +450,9 @@ tasks.register("runIntegrationTests"){
dependsOn tasks.getByPath(":logstash-integration-tests:integrationTests")
dependsOn copyEs
dependsOn copyFilebeat
shouldRunAfter ":logstash-core:test"
}
bootstrap.dependsOn assemblyDeps
runIntegrationTests.shouldRunAfter tasks.getByPath(":logstash-core:test")
check.dependsOn runIntegrationTests
tasks.register("generateLicenseReport", JavaExec) {
@ -506,11 +503,8 @@ tasks.register("generatePluginsVersion") {
}
bootstrap.dependsOn assemblyDeps
runIntegrationTests.shouldRunAfter tasks.getByPath(":logstash-core:test")
check.dependsOn runIntegrationTests
Boolean oss = System.getenv('OSS').equals('true')
if (!oss) {
@ -520,11 +514,12 @@ if (!oss) {
dependsOn installTestGems
}
}
tasks.getByPath(":logstash-xpack:rubyIntegrationTests").configure {
dependsOn copyEs
}
}
task runXPackUnitTests(dependsOn: [tasks.getByPath(":logstash-xpack:rubyTests")]) {}
task runXPackIntegrationTests(dependsOn: [tasks.getByPath(":logstash-xpack:rubyIntegrationTests")]) {}
tasks.register("runXPackUnitTests"){
dependsOn ":logstash-xpack:rubyTests"
}
tasks.register("runXPackIntegrationTests"){
dependsOn ":logstash-xpack:rubyIntegrationTests"
}

View file

@ -35,6 +35,7 @@ tasks.register("rubyTests", Test) {
}
tasks.register("rubyIntegrationTests", Test) {
dependsOn (":copyEs")
inputs.files fileTree("${projectDir}/qa")
inputs.files fileTree("${projectDir}/lib")
inputs.files fileTree("${projectDir}/modules")