Avoid creating unused test tasks (#74644)
With the overall theme of trying to configure and add less to the build instead of just disabling it later, we're replacing standalone-test by standalone-rest tasks avoids creating the unused test tasks. Standalone rest test plugin and the other rest test plugins behave a little bit different in the sense how source sets and test tasks are wired. The standalone rest test plugin assumes that all RestTestTasks are using the same sourceSet (test). The yaml, java Rest test plugins use one dedicated sourceSet per test task. In the long run we probably will migrate standalone-rest-test usages to one of the other plugins and deprecate standalone-rest-test
This commit is contained in:
parent
603ebf7b7f
commit
d8e4e48a3b
|
@ -34,5 +34,4 @@ tasks.withType(Test).configureEach {
|
|||
}
|
||||
|
||||
tasks.matching { it.name.equals("check") }.configureEach {dependsOn(bwcTestSnapshots) }
|
||||
|
||||
tasks.matching { it.name.equals("test") }.configureEach {enabled = false}
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-test-artifact'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
dependencies {
|
||||
|
@ -46,6 +46,4 @@ tasks.register("integTest") {
|
|||
dependsOn "mixedClusterTest"
|
||||
}
|
||||
|
||||
tasks.named("test").configure { enabled = false }// no unit tests for multi-cluster-search, only integration tests
|
||||
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.internal-test-artifact'
|
||||
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
||||
for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
|
||||
|
|
|
@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation(testArtifact(project(xpackModule('core'))))
|
||||
|
@ -61,8 +61,6 @@ tasks.register("follow-cluster", RestIntegTestTask) {
|
|||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
||||
// no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("test").configure { enabled = false }
|
||||
|
||||
// We can't run in FIPS mode with a basic license
|
||||
tasks.withType(Test).configureEach {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation(testArtifact(project(xpackModule('core'))))
|
||||
|
@ -67,5 +67,4 @@ testClusters.matching { it.name == "follow-cluster" }.configureEach {
|
|||
{ "\"${testClusters.named('middle-cluster').get().getAllTransportPortURI().join(",")}\"" }
|
||||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
||||
tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
|
@ -1,7 +1,7 @@
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation(testArtifact(project(xpackModule('core'))))
|
||||
|
@ -39,5 +39,4 @@ tasks.register('follow-cluster', RestIntegTestTask) {
|
|||
{ "${testClusters.'follow-cluster'.getAllHttpSocketURI().get(0)}" }
|
||||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
||||
tasks.named("test").configure { enabled = false }
|
||||
tasks.named("check").configure { dependsOn "follow-cluster" }
|
|
@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation project(':x-pack:plugin:ccr:qa')
|
||||
|
@ -56,4 +56,3 @@ tasks.register("followClusterRestartTest", StandaloneRestIntegTestTask) {
|
|||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn "followClusterRestartTest" }
|
||||
tasks.named("test").configure { enabled = false }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation(testArtifact(project(xpackModule('core'))))
|
||||
|
@ -54,6 +54,4 @@ tasks.register('follow-cluster', RestIntegTestTask) {
|
|||
nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}"
|
||||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn('follow-cluster') }
|
||||
// no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("test").configure { enabled = false }
|
||||
tasks.named("check").configure { dependsOn('follow-cluster') }
|
|
@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
|||
import org.elasticsearch.gradle.internal.info.BuildParams
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation project(':x-pack:plugin:ccr:qa')
|
||||
|
@ -56,10 +56,8 @@ testClusters.matching{ it.name == 'follow-cluster' }.configureEach {
|
|||
}
|
||||
|
||||
tasks.named("check").configure { dependsOn 'follow-cluster' }
|
||||
// no unit tests for this module, only the rest integration test
|
||||
tasks.named("test").configure { enabled = false }
|
||||
// Security is explicitly disabled for follow-cluster and leader-cluster, do not run these in FIPS mode
|
||||
tasks.withType(Test).configureEach {
|
||||
onlyIf { BuildParams.inFipsJvm == false}
|
||||
enabled = BuildParams.inFipsJvm == false
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
dependencies {
|
||||
|
@ -63,5 +63,4 @@ tasks.register("integTest") {
|
|||
dependsOn 'mixed-cluster'
|
||||
}
|
||||
|
||||
tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -3,7 +3,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
||||
dependencies {
|
||||
|
@ -75,7 +75,6 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
|
|||
exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class'
|
||||
}
|
||||
|
||||
|
||||
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
|
||||
mustRunAfter("precommit")
|
||||
useCluster testClusters."${baseName}"
|
||||
|
|
|
@ -2,7 +2,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.internal.test.RestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
dependencies {
|
||||
|
@ -77,5 +77,4 @@ tasks.register("integTest") {
|
|||
dependsOn 'mixed-cluster'
|
||||
}
|
||||
|
||||
tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test
|
||||
tasks.named("check").configure { dependsOn("integTest") }
|
||||
|
|
|
@ -3,16 +3,12 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
||||
dependencies {
|
||||
testImplementation project(':x-pack:qa')
|
||||
}
|
||||
if (BuildParams.inFipsJvm){
|
||||
// This test is testing rolling upgrades with a BASIC license and FIPS 140 mode is not available in BASIC
|
||||
tasks.withType(Test).configureEach{ enabled = false }
|
||||
}
|
||||
|
||||
for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
||||
String baseName = "v${bwcVersion}"
|
||||
|
@ -87,8 +83,9 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
|||
|
||||
// Security is explicitly disabled, do not run tests in FIPS mode
|
||||
tasks.withType(Test).configureEach {
|
||||
onlyIf { BuildParams.inFipsJvm == false}
|
||||
enabled = BuildParams.inFipsJvm == false
|
||||
}
|
||||
|
||||
tasks.named("testingConventions").configure {
|
||||
onlyIf { BuildParams.inFipsJvm == false }
|
||||
enabled = BuildParams.inFipsJvm == false
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -3,7 +3,7 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
||||
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.standalone-test'
|
||||
apply plugin: 'elasticsearch.standalone-rest-test'
|
||||
apply plugin: 'elasticsearch.bwc-test'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
|
|
Loading…
Reference in New Issue