2019-02-14 02:12:14 -05:00
|
|
|
import org.elasticsearch.gradle.Version
|
2020-05-11 03:39:13 -04:00
|
|
|
import org.elasticsearch.gradle.info.BuildParams
|
2020-08-04 08:46:32 -04:00
|
|
|
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
2019-02-14 02:12:14 -05:00
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
2019-02-14 02:12:14 -05:00
|
|
|
apply plugin: 'elasticsearch.standalone-test'
|
2020-03-03 17:40:55 -05:00
|
|
|
apply from : "$rootDir/gradle/bwc-test.gradle"
|
2019-02-14 02:12:14 -05:00
|
|
|
|
|
|
|
dependencies {
|
2020-06-14 16:30:44 -04:00
|
|
|
testImplementation project(':x-pack:qa')
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
|
|
|
|
2020-05-11 03:39:13 -04:00
|
|
|
for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
|
2019-11-14 06:01:23 -05:00
|
|
|
String baseName = "v${bwcVersion}"
|
|
|
|
|
|
|
|
testClusters {
|
|
|
|
"${baseName}-leader" {
|
|
|
|
numberOfNodes = 3
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
"${baseName}-follower" {
|
|
|
|
numberOfNodes = 3
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
2020-06-12 15:33:56 -04:00
|
|
|
testClusters.matching { it.name.startsWith("${baseName}-") }.all {
|
2019-11-14 06:01:23 -05:00
|
|
|
testDistribution = "DEFAULT"
|
|
|
|
versions = [bwcVersion.toString(), project.version]
|
|
|
|
|
|
|
|
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
|
|
|
|
setting 'xpack.security.enabled', 'false'
|
|
|
|
setting 'xpack.ml.enabled', 'false'
|
|
|
|
setting 'xpack.watcher.enabled', 'false'
|
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.withType(StandaloneRestIntegTestTask).matching { it.name.startsWith("${baseName}#") }.all {
|
2019-11-14 06:01:23 -05:00
|
|
|
useCluster testClusters."${baseName}-leader"
|
|
|
|
useCluster testClusters."${baseName}-follower"
|
|
|
|
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
|
|
|
|
|
|
|
doFirst {
|
|
|
|
if (name.endsWith("#clusterTest") == false) {
|
|
|
|
println "Upgrade node $it"
|
|
|
|
testClusters."${baseName}-${kindExt}".nextNodeToNextVersion()
|
|
|
|
}
|
|
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",")}")
|
|
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName()}")
|
|
|
|
nonInputProperties.systemProperty('tests.leader_host', "${-> testClusters."${baseName}-leader".allHttpSocketURI.last()}")
|
|
|
|
nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', "${-> testClusters."${baseName}-leader".allTransportPortURI.last()}")
|
|
|
|
nonInputProperties.systemProperty('tests.follower_host', "${-> testClusters."${baseName}-follower".allHttpSocketURI.last()}")
|
|
|
|
nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', "${-> testClusters."${baseName}-follower".allTransportPortURI.last()}")
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
2019-02-14 02:12:14 -05:00
|
|
|
|
2019-11-14 06:01:23 -05:00
|
|
|
for (kind in ["follower", "leader"]) {
|
|
|
|
// Attention!! Groovy trap: do not pass `kind` to a closure
|
2019-02-14 02:12:14 -05:00
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#${kind}#clusterTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
systemProperty 'tests.rest.upgrade_state', 'none'
|
|
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
|
|
ext.kindExt = kind
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#${kind}#oneThirdUpgradedTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
systemProperty 'tests.rest.upgrade_state', 'one_third'
|
|
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
|
|
dependsOn "${baseName}#leader#clusterTest", "${baseName}#follower#clusterTest"
|
|
|
|
ext.kindExt = kind
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#${kind}#twoThirdsUpgradedTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
systemProperty 'tests.rest.upgrade_state', 'two_third'
|
|
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
|
|
dependsOn "${baseName}#${kind}#oneThirdUpgradedTest"
|
|
|
|
ext.kindExt = kind
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.create("${baseName}#${kind}#upgradedClusterTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
systemProperty 'tests.rest.upgrade_state', 'all'
|
|
|
|
systemProperty 'tests.rest.cluster_name', kind
|
|
|
|
dependsOn "${baseName}#${kind}#twoThirdsUpgradedTest"
|
|
|
|
ext.kindExt = kind
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("${baseName}#follower#clusterTest") {
|
|
|
|
dependsOn "${baseName}#leader#clusterTest"
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.named("${baseName}#leader#oneThirdUpgradedTest") {
|
|
|
|
dependsOn "${baseName}#follower#upgradedClusterTest"
|
|
|
|
}
|
|
|
|
|
2020-03-03 17:40:55 -05:00
|
|
|
tasks.register(bwcTaskName(bwcVersion)) {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn "${baseName}#leader#upgradedClusterTest"
|
|
|
|
}
|
2019-02-14 02:12:14 -05:00
|
|
|
}
|