mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-15 17:35:41 +00:00
Welp, I broke this. I merged a change to auto-discover the CCR QA tests by making :x-pack:plugin:ccr:check auto-discover the check tasks in the qa sub-project. Yet, the check tasks for these sub-projects did not depend on the necessary test tasks (as we were previously doing this directly from the ccr build file. This commit fixes this!
76 lines
2.9 KiB
Groovy
76 lines
2.9 KiB
Groovy
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')
|
|
}
|
|
|
|
task leaderClusterTest(type: RestIntegTestTask) {
|
|
mustRunAfter(precommit)
|
|
}
|
|
|
|
leaderClusterTestCluster {
|
|
numNodes = 1
|
|
clusterName = 'leader-cluster'
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
setting 'xpack.security.enabled', 'true'
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
extraConfigFile 'roles.yml', 'roles.yml'
|
|
setupCommand 'setupTestAdmin',
|
|
'bin/elasticsearch-users', 'useradd', "test_admin", '-p', 'x-pack-test-password', '-r', "superuser"
|
|
setupCommand 'setupCcrUser',
|
|
'bin/elasticsearch-users', 'useradd', "test_ccr", '-p', 'x-pack-test-password', '-r', "manage_ccr"
|
|
waitCondition = { node, ant ->
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
dest: tmpFile.toString(),
|
|
username: 'test_admin',
|
|
password: 'x-pack-test-password',
|
|
ignoreerrors: true,
|
|
retries: 10)
|
|
return tmpFile.exists()
|
|
}
|
|
}
|
|
|
|
leaderClusterTestRunner {
|
|
systemProperty 'tests.is_leader_cluster', 'true'
|
|
}
|
|
|
|
task followClusterTest(type: RestIntegTestTask) {}
|
|
|
|
followClusterTestCluster {
|
|
dependsOn leaderClusterTestRunner
|
|
numNodes = 1
|
|
clusterName = 'follow-cluster'
|
|
setting 'search.remote.leader_cluster.seeds', "\"${-> leaderClusterTest.nodes.get(0).transportUri()}\""
|
|
setting 'xpack.license.self_generated.type', 'trial'
|
|
setting 'xpack.security.enabled', 'true'
|
|
setting 'xpack.monitoring.enabled', 'false'
|
|
extraConfigFile 'roles.yml', 'roles.yml'
|
|
setupCommand 'setupTestAdmin',
|
|
'bin/elasticsearch-users', 'useradd', "test_admin", '-p', 'x-pack-test-password', '-r', "superuser"
|
|
setupCommand 'setupCcrUser',
|
|
'bin/elasticsearch-users', 'useradd', "test_ccr", '-p', 'x-pack-test-password', '-r', "ccruser"
|
|
waitCondition = { node, ant ->
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
|
ant.get(src: "http://${node.httpUri()}/_cluster/health?wait_for_nodes=>=${numNodes}&wait_for_status=yellow",
|
|
dest: tmpFile.toString(),
|
|
username: 'test_admin',
|
|
password: 'x-pack-test-password',
|
|
ignoreerrors: true,
|
|
retries: 10)
|
|
return tmpFile.exists()
|
|
}
|
|
}
|
|
|
|
followClusterTestRunner {
|
|
systemProperty 'tests.is_leader_cluster', 'false'
|
|
systemProperty 'tests.leader_host', "${-> leaderClusterTest.nodes.get(0).httpUri()}"
|
|
finalizedBy 'leaderClusterTestCluster#stop'
|
|
}
|
|
|
|
check.dependsOn followClusterTest
|
|
test.enabled = false // no unit tests for multi-cluster-search, only the rest integration test
|