2018-03-09 11:54:30 -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
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
2018-03-09 11:54:30 -05:00
|
|
|
apply plugin: 'elasticsearch.standalone-test'
|
2020-03-03 17:40:55 -05:00
|
|
|
apply from : "$rootDir/gradle/bwc-test.gradle"
|
2018-03-09 11:54:30 -05:00
|
|
|
|
|
|
|
dependencies {
|
2020-06-14 16:30:44 -04:00
|
|
|
testImplementation project(':x-pack:qa')
|
2018-03-09 11:54:30 -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}" {
|
|
|
|
testDistribution = "DEFAULT"
|
|
|
|
versions = [bwcVersion.toString(), project.version]
|
|
|
|
numberOfNodes = 3
|
|
|
|
|
|
|
|
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', 'basic'
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
useCluster testClusters."${baseName}"
|
|
|
|
mustRunAfter(precommit)
|
|
|
|
systemProperty 'tests.rest.suite', 'old_cluster'
|
|
|
|
systemProperty 'tests.upgrade_from_version', version.toString().replace('-SNAPSHOT', '')
|
|
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
|
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
|
|
|
|
}
|
|
|
|
|
2020-04-08 19:47:02 -04:00
|
|
|
String oldVersion = bwcVersion.toString().replace('-SNAPSHOT', '')
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#oneThirdUpgradedTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn "${baseName}#oldClusterTest"
|
|
|
|
useCluster testClusters."${baseName}"
|
|
|
|
doFirst {
|
|
|
|
testClusters."${baseName}".nextNodeToNextVersion()
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
|
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
|
|
|
|
systemProperty 'tests.rest.suite', 'mixed_cluster'
|
|
|
|
systemProperty 'tests.first_round', 'true'
|
2020-04-08 19:47:02 -04:00
|
|
|
systemProperty 'tests.upgrade_from_version', oldVersion
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#twoThirdsUpgradedTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn "${baseName}#oneThirdUpgradedTest"
|
|
|
|
useCluster testClusters."${baseName}"
|
|
|
|
doFirst {
|
|
|
|
testClusters."${baseName}".nextNodeToNextVersion()
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
|
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
|
|
|
|
systemProperty 'tests.rest.suite', 'mixed_cluster'
|
|
|
|
systemProperty 'tests.first_round', 'false'
|
2020-04-08 19:47:02 -04:00
|
|
|
systemProperty 'tests.upgrade_from_version', oldVersion
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
|
|
|
|
2020-08-04 08:46:32 -04:00
|
|
|
tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn "${baseName}#twoThirdsUpgradedTest"
|
|
|
|
useCluster testClusters."${baseName}"
|
|
|
|
doFirst {
|
|
|
|
testClusters."${baseName}".nextNodeToNextVersion()
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
|
|
|
|
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
|
|
|
|
systemProperty 'tests.rest.suite', 'upgraded_cluster'
|
2020-04-08 19:47:02 -04:00
|
|
|
systemProperty 'tests.upgrade_from_version', oldVersion
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
|
|
|
|
2020-03-03 17:40:55 -05:00
|
|
|
tasks.register(bwcTaskName(bwcVersion)) {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn "${baseName}#upgradedClusterTest"
|
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|