2018-11-09 11:43:43 -05:00
|
|
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
|
|
|
|
|
|
|
apply plugin: 'elasticsearch.standalone-test'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
|
|
|
|
testCompile project(path: xpackModule('ccr'), configuration: 'runtime')
|
|
|
|
testCompile project(':x-pack:plugin:ccr:qa')
|
|
|
|
}
|
|
|
|
|
|
|
|
task leaderClusterTest(type: RestIntegTestTask) {
|
|
|
|
mustRunAfter(precommit)
|
|
|
|
}
|
|
|
|
|
|
|
|
leaderClusterTestCluster {
|
|
|
|
numNodes = 1
|
|
|
|
clusterName = 'leader-cluster'
|
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
|
|
}
|
|
|
|
|
|
|
|
leaderClusterTestRunner {
|
|
|
|
systemProperty 'tests.target_cluster', 'leader'
|
|
|
|
}
|
|
|
|
|
|
|
|
task writeJavaPolicy {
|
|
|
|
doLast {
|
|
|
|
final File tmp = file("${buildDir}/tmp")
|
|
|
|
if (tmp.exists() == false && tmp.mkdirs() == false) {
|
|
|
|
throw new GradleException("failed to create temporary directory [${tmp}]")
|
|
|
|
}
|
|
|
|
final File javaPolicy = file("${tmp}/java.policy")
|
|
|
|
javaPolicy.write(
|
|
|
|
[
|
|
|
|
"grant {",
|
|
|
|
" permission java.io.FilePermission \"${-> followClusterTest.getNodes().get(0).homeDir}/logs/${-> followClusterTest.getNodes().get(0).clusterName}.log\", \"read\";",
|
|
|
|
"};"
|
|
|
|
].join("\n"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task followClusterTest(type: RestIntegTestTask) {}
|
|
|
|
followClusterTest.dependsOn writeJavaPolicy
|
|
|
|
|
|
|
|
followClusterTestCluster {
|
|
|
|
dependsOn leaderClusterTestRunner
|
|
|
|
numNodes = 1
|
|
|
|
clusterName = 'follow-cluster'
|
|
|
|
setting 'xpack.monitoring.collection.enabled', 'true'
|
|
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
|
|
setting 'cluster.remote.leader_cluster.seeds', "\"${-> leaderClusterTest.nodes.get(0).transportUri()}\""
|
|
|
|
}
|
|
|
|
|
|
|
|
followClusterTestRunner {
|
|
|
|
systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy"
|
|
|
|
systemProperty 'tests.target_cluster', 'follow'
|
|
|
|
systemProperty 'tests.leader_host', "${-> leaderClusterTest.nodes.get(0).httpUri()}"
|
|
|
|
systemProperty 'log', "${-> followClusterTest.getNodes().get(0).homeDir}/logs/${-> followClusterTest.getNodes().get(0).clusterName}.log"
|
|
|
|
finalizedBy 'leaderClusterTestCluster#stop'
|
|
|
|
}
|
|
|
|
|
|
|
|
check.dependsOn followClusterTest
|
2018-12-19 01:25:20 -05:00
|
|
|
unitTest.enabled = false // no unit tests for multi-cluster-search, only the rest integration test
|