From 73417bf09afdfa6eeb7a7d620218b843e8d2653e Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 15 Sep 2018 10:18:59 -0400 Subject: [PATCH] Move CCR REST tests to a sub-project of ccr This commit moves these REST tests (possibly temporarily) to a sub-project of ccr. We do this (again, possibly temporarily) to keep them within the ccr sub-project yet there are changes within 6.x that prevent these from being in the top-level project (the cluster formation tasks are trying to install x-pack-ccr into the integ-test-zip). Therefore, we isolate these for now until we can understand why there are differences between 6.x and master. --- x-pack/plugin/ccr/build.gradle | 24 ++----------- x-pack/plugin/ccr/qa/rest/build.gradle | 36 +++++++++++++++++++ .../elasticsearch/xpack/ccr/CcrRestIT.java | 0 .../api/ccr.create_and_follow_index.json | 0 .../api/ccr.delete_auto_follow_pattern.json | 0 .../rest-api-spec/api/ccr.follow_index.json | 0 .../api/ccr.put_auto_follow_pattern.json | 0 .../rest-api-spec/api/ccr.stats.json | 0 .../rest-api-spec/api/ccr.unfollow_index.json | 0 .../rest-api-spec/test/ccr/auto_follow.yml | 0 .../test/ccr/follow_and_unfollow.yml | 0 .../rest-api-spec/test/ccr/stats.yml | 0 12 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 x-pack/plugin/ccr/qa/rest/build.gradle rename x-pack/plugin/ccr/{ => qa/rest}/src/test/java/org/elasticsearch/xpack/ccr/CcrRestIT.java (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.create_and_follow_index.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.follow_index.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.stats.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/api/ccr.unfollow_index.json (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml (100%) rename x-pack/plugin/ccr/{ => qa/rest}/src/test/resources/rest-api-spec/test/ccr/stats.yml (100%) diff --git a/x-pack/plugin/ccr/build.gradle b/x-pack/plugin/ccr/build.gradle index f4c7c09c19e..ea8aa897777 100644 --- a/x-pack/plugin/ccr/build.gradle +++ b/x-pack/plugin/ccr/build.gradle @@ -14,6 +14,8 @@ esplugin { } archivesBaseName = 'x-pack-ccr' +integTest.enabled = false + compileJava.options.compilerArgs << "-Xlint:-try" compileTestJava.options.compilerArgs << "-Xlint:-try" @@ -27,31 +29,9 @@ task internalClusterTest(type: RandomizedTestingTask, classpath = project.test.classpath testClassesDirs = project.test.testClassesDirs include '**/*IT.class' - exclude '**/CcrRestIT.class' systemProperty 'es.set.netty.runtime.available.processors', 'false' } -integTestCluster { - distribution 'zip' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.security.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - // TODO: reduce the need for superuser here - setupCommand 'setup-ccr-user', - 'bin/elasticsearch-users', 'useradd', 'ccr-user', '-p', 'ccr-user-password', '-r', 'superuser' - 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: 'ccr-user', - password: 'ccr-user-password', - ignoreerrors: true, - retries: 10) - return tmpFile.exists() - } -} - check.dependsOn internalClusterTest internalClusterTest.mustRunAfter test diff --git a/x-pack/plugin/ccr/qa/rest/build.gradle b/x-pack/plugin/ccr/qa/rest/build.gradle new file mode 100644 index 00000000000..cfd24123f42 --- /dev/null +++ b/x-pack/plugin/ccr/qa/rest/build.gradle @@ -0,0 +1,36 @@ +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 restTest(type: RestIntegTestTask) { + mustRunAfter(precommit) +} + +restTestCluster { + distribution 'zip' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.security.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + // TODO: reduce the need for superuser here + setupCommand 'setup-ccr-user', + 'bin/elasticsearch-users', 'useradd', 'ccr-user', '-p', 'ccr-user-password', '-r', 'superuser' + 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: 'ccr-user', + password: 'ccr-user-password', + ignoreerrors: true, + retries: 10) + return tmpFile.exists() + } +} + +check.dependsOn restTest +test.enabled = false diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRestIT.java b/x-pack/plugin/ccr/qa/rest/src/test/java/org/elasticsearch/xpack/ccr/CcrRestIT.java similarity index 100% rename from x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrRestIT.java rename to x-pack/plugin/ccr/qa/rest/src/test/java/org/elasticsearch/xpack/ccr/CcrRestIT.java diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.create_and_follow_index.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.create_and_follow_index.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.create_and_follow_index.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.create_and_follow_index.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.delete_auto_follow_pattern.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.follow_index.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.follow_index.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.follow_index.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.follow_index.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.put_auto_follow_pattern.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.stats.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.stats.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.stats.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.stats.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.unfollow_index.json b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.unfollow_index.json similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/api/ccr.unfollow_index.json rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/api/ccr.unfollow_index.json diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/auto_follow.yml diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/follow_and_unfollow.yml diff --git a/x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/stats.yml b/x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/stats.yml similarity index 100% rename from x-pack/plugin/ccr/src/test/resources/rest-api-spec/test/ccr/stats.yml rename to x-pack/plugin/ccr/qa/rest/src/test/resources/rest-api-spec/test/ccr/stats.yml