2017-05-27 02:07:48 +08:00
|
|
|
/*
|
2021-02-03 05:41:39 +08:00
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
|
|
* Side Public License, v 1.
|
2017-05-27 02:07:48 +08:00
|
|
|
*/
|
|
|
|
|
2017-11-21 16:26:45 +08:00
|
|
|
|
2017-05-27 02:07:48 +08:00
|
|
|
import org.elasticsearch.gradle.Version
|
2021-04-26 20:53:55 +08:00
|
|
|
import org.elasticsearch.gradle.internal.info.BuildParams
|
2021-05-09 17:36:16 +08:00
|
|
|
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
2017-05-27 02:07:48 +08:00
|
|
|
|
2021-05-06 20:02:35 +08:00
|
|
|
apply plugin: 'elasticsearch.internal-testclusters'
|
2021-06-30 20:11:25 +08:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
2021-02-16 21:36:17 +08:00
|
|
|
apply plugin: 'elasticsearch.internal-test-artifact'
|
2021-04-29 15:33:28 +08:00
|
|
|
apply plugin: 'elasticsearch.bwc-test'
|
2017-05-27 02:07:48 +08:00
|
|
|
|
2020-05-07 18:08:17 +08:00
|
|
|
for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
|
2019-08-16 20:53:23 +08:00
|
|
|
String baseName = "v${bwcVersion}"
|
2017-05-27 02:07:48 +08:00
|
|
|
|
2019-08-16 20:53:23 +08:00
|
|
|
testClusters {
|
|
|
|
"${baseName}" {
|
2019-11-13 18:14:04 +08:00
|
|
|
versions = [bwcVersion.toString(), project.version]
|
2019-08-16 20:53:23 +08:00
|
|
|
numberOfNodes = 2
|
|
|
|
// some tests rely on the translog not being flushed
|
2020-01-30 22:02:38 +08:00
|
|
|
setting 'indices.memory.shard_inactive_time', '60m'
|
2019-08-16 20:53:23 +08:00
|
|
|
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
|
2021-04-14 00:33:41 +08:00
|
|
|
setting 'xpack.security.enabled', 'false'
|
2017-05-27 02:07:48 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-03 18:07:41 +08:00
|
|
|
tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) {
|
2019-08-16 20:53:23 +08:00
|
|
|
useCluster testClusters."${baseName}"
|
2020-11-12 19:04:15 +08:00
|
|
|
mustRunAfter("precommit")
|
2019-08-16 20:53:23 +08:00
|
|
|
doFirst {
|
2020-10-01 16:47:41 +08:00
|
|
|
delete("${buildDir}/cluster/shared/repo/${baseName}")
|
2019-08-16 20:53:23 +08:00
|
|
|
}
|
2017-05-27 02:07:48 +08:00
|
|
|
|
2019-08-16 20:53:23 +08:00
|
|
|
systemProperty 'tests.is_old_cluster', 'true'
|
2017-05-27 02:07:48 +08:00
|
|
|
}
|
|
|
|
|
2020-08-03 18:07:41 +08:00
|
|
|
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
|
2019-08-16 20:53:23 +08:00
|
|
|
useCluster testClusters."${baseName}"
|
|
|
|
dependsOn "${baseName}#oldClusterTest"
|
|
|
|
doFirst {
|
|
|
|
testClusters."${baseName}".goToNextVersion()
|
|
|
|
}
|
2017-05-27 02:07:48 +08:00
|
|
|
systemProperty 'tests.is_old_cluster', 'false'
|
|
|
|
}
|
|
|
|
|
2020-04-09 06:31:24 +08:00
|
|
|
String oldVersion = bwcVersion.toString().minus("-SNAPSHOT")
|
2019-08-16 20:53:23 +08:00
|
|
|
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
|
2020-04-09 06:31:24 +08:00
|
|
|
it.systemProperty 'tests.old_cluster_version', oldVersion
|
2019-08-16 20:53:23 +08:00
|
|
|
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
|
2019-11-13 18:14:04 +08:00
|
|
|
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
|
|
|
it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
|
2017-05-27 02:07:48 +08:00
|
|
|
}
|
|
|
|
|
2020-03-04 06:40:55 +08:00
|
|
|
tasks.register(bwcTaskName(bwcVersion)) {
|
|
|
|
dependsOn tasks.named("${baseName}#upgradedClusterTest")
|
2017-06-15 13:01:49 +08:00
|
|
|
}
|
2021-04-14 00:33:41 +08:00
|
|
|
}
|