2018-03-09 11:54:30 -05:00
|
|
|
import org.elasticsearch.gradle.Version
|
2019-11-01 14:33:11 -04:00
|
|
|
import org.elasticsearch.gradle.info.BuildParams
|
2019-10-04 09:12:53 -04:00
|
|
|
import org.elasticsearch.gradle.testclusters.RestTestRunnerTask
|
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'
|
|
|
|
|
|
|
|
dependencies {
|
2019-11-14 06:01:23 -05:00
|
|
|
testCompile project(':x-pack:qa')
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
tasks.register("bwcTest") {
|
2019-11-14 06:01:23 -05:00
|
|
|
description = 'Runs backwards compatibility tests.'
|
|
|
|
group = 'verification'
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
configurations {
|
2019-11-14 06:01:23 -05:00
|
|
|
restSpec
|
2019-10-04 09:12:53 -04:00
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
dependencies {
|
2019-11-14 06:01:23 -05:00
|
|
|
restSpec project(':rest-api-spec')
|
2019-10-04 09:12:53 -04:00
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
processTestResources {
|
2019-11-14 06:01:23 -05:00
|
|
|
dependsOn configurations.restSpec
|
|
|
|
from({ zipTree(configurations.restSpec.singleFile) }) {
|
|
|
|
include 'rest-api-spec/api/**'
|
|
|
|
}
|
|
|
|
from(project(xpackProject('plugin').path).sourceSets.test.resources) {
|
|
|
|
include 'rest-api-spec/api/**'
|
|
|
|
}
|
2019-10-04 09:12:53 -04:00
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2018-11-02 03:46:05 -04:00
|
|
|
|
2019-10-04 09:12:53 -04:00
|
|
|
for (Version bwcVersion : 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.monitoring.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
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) {
|
|
|
|
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()}")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) {
|
|
|
|
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'
|
|
|
|
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) {
|
|
|
|
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'
|
|
|
|
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) {
|
|
|
|
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'
|
|
|
|
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("${baseName}#bwcTest") {
|
|
|
|
dependsOn "${baseName}#upgradedClusterTest"
|
|
|
|
}
|
|
|
|
|
|
|
|
if (project.bwc_tests_enabled) {
|
|
|
|
bwcTest.dependsOn("${baseName}#bwcTest")
|
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
|
|
|
|
2019-02-11 07:58:00 -05:00
|
|
|
task bwcTestSnapshots {
|
2019-11-14 06:01:23 -05:00
|
|
|
if (project.bwc_tests_enabled) {
|
|
|
|
for (final def version : bwcVersions.unreleasedWireCompatible) {
|
|
|
|
dependsOn "v${version}#bwcTest"
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-11-14 06:01:23 -05:00
|
|
|
}
|
2018-03-09 11:54:30 -05:00
|
|
|
}
|
2019-02-11 07:58:00 -05:00
|
|
|
check.dependsOn(bwcTestSnapshots)
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2019-04-05 02:01:56 -04:00
|
|
|
compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked"
|
2018-03-09 11:54:30 -05:00
|
|
|
|
2019-11-14 06:01:23 -05:00
|
|
|
test.enabled = false
|