2019-03-18 21:47:52 -04:00
|
|
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
2019-08-09 06:32:27 -04:00
|
|
|
import org.elasticsearch.gradle.testclusters.RestTestRunnerTask
|
2019-03-18 21:47:52 -04:00
|
|
|
|
2019-05-29 09:16:04 -04:00
|
|
|
apply plugin: 'elasticsearch.testclusters'
|
2019-03-18 21:47:52 -04:00
|
|
|
apply plugin: 'elasticsearch.standalone-test'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testCompile project(':x-pack:plugin:ccr:qa')
|
|
|
|
}
|
|
|
|
|
2019-05-29 09:16:04 -04:00
|
|
|
task 'leader-cluster'(type: RestIntegTestTask) {
|
2019-03-18 21:47:52 -04:00
|
|
|
mustRunAfter(precommit)
|
2019-05-29 09:16:04 -04:00
|
|
|
runner {
|
|
|
|
systemProperty 'tests.target_cluster', 'leader'
|
|
|
|
}
|
2019-03-18 21:47:52 -04:00
|
|
|
}
|
2019-05-29 09:16:04 -04:00
|
|
|
testClusters.'leader-cluster' {
|
2019-07-15 20:53:05 -04:00
|
|
|
testDistribution = 'DEFAULT'
|
2019-03-18 21:47:52 -04:00
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
|
|
}
|
|
|
|
|
2019-05-29 09:16:04 -04:00
|
|
|
task 'follow-cluster'(type: RestIntegTestTask) {
|
|
|
|
dependsOn 'leader-cluster'
|
|
|
|
runner {
|
2019-08-09 06:32:27 -04:00
|
|
|
useCluster testClusters.'leader-cluster'
|
2019-05-29 09:16:04 -04:00
|
|
|
systemProperty 'tests.target_cluster', 'follow'
|
|
|
|
nonInputProperties.systemProperty 'tests.leader_host',
|
|
|
|
"${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}"
|
|
|
|
}
|
2019-03-18 21:47:52 -04:00
|
|
|
}
|
2019-05-29 09:16:04 -04:00
|
|
|
testClusters.'follow-cluster' {
|
2019-07-15 20:53:05 -04:00
|
|
|
testDistribution = 'DEFAULT'
|
2019-03-18 21:47:52 -04:00
|
|
|
setting 'xpack.monitoring.collection.enabled', 'true'
|
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
2019-05-29 09:16:04 -04:00
|
|
|
setting 'cluster.remote.leader_cluster.seeds',
|
|
|
|
{ "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" }
|
|
|
|
nameCustomization = { 'follow' }
|
2019-03-18 21:47:52 -04:00
|
|
|
}
|
|
|
|
|
2019-08-09 06:32:27 -04:00
|
|
|
task followClusterRestartTest(type: RestTestRunnerTask) {
|
2019-05-29 09:16:04 -04:00
|
|
|
dependsOn tasks.'follow-cluster'
|
|
|
|
useCluster testClusters.'leader-cluster'
|
|
|
|
useCluster testClusters.'follow-cluster'
|
2019-03-18 21:47:52 -04:00
|
|
|
|
2019-05-29 09:16:04 -04:00
|
|
|
systemProperty 'tests.rest.load_packaged', 'false'
|
2019-03-18 21:47:52 -04:00
|
|
|
systemProperty 'tests.target_cluster', 'follow-restart'
|
2019-05-29 09:16:04 -04:00
|
|
|
doFirst {
|
|
|
|
testClusters.'follow-cluster'.restart()
|
|
|
|
nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}"
|
|
|
|
nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.'follow-cluster'.getAllHttpSocketURI().join(",")}"
|
|
|
|
}
|
2019-03-18 21:47:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
check.dependsOn followClusterRestartTest
|
2019-04-09 14:52:50 -04:00
|
|
|
test.enabled = false
|