Browse Source

Reindex: Fold "with all deps" project into reindex (#30154)

This folds the `:qa:smoke-test-reindex-with-all-modules` project into
`:modules:reindex` by declaring the reindex's integration testing
cluster requires the `parent-join` and `lang-painless` plugins and then
moving all of the integration tests that depended on parent-join and
painless into reindex.

It saves us one cluster start up during the build at the cost of a
little of the reindex module's "purity". Since the reindex module *does*
have unit tests that test scripting without painless I'm fairly ok with
that.
Nik Everett 7 năm trước cách đây
mục cha
commit
51fa8739ea

+ 6 - 0
modules/reindex/build.gradle

@@ -30,11 +30,17 @@ esplugin {
 }
 
 integTestCluster {
+  // Modules who's integration is explicitly tested in integration tests
+  module project(':modules:parent-join')
+  module project(':modules:lang-painless')
   // Whitelist reindexing from the local node so we can test reindex-from-remote.
   setting 'reindex.remote.whitelist', '127.0.0.1:*'
 }
 
 run {
+  // Modules who's integration is explicitly tested in integration tests
+  module project(':modules:parent-join')
+  module project(':modules:lang-painless')
   // Whitelist reindexing from the local node so we can test reindex-from-remote.
   setting 'reindex.remote.whitelist', '127.0.0.1:*'
 }

+ 1 - 1
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/reindex/40_search_failures.yml → modules/reindex/src/test/resources/rest-api-spec/test/reindex/35_search_failures.yml

@@ -1,5 +1,5 @@
 ---
-"Response format search failures":
+"Response format for search failures":
   - do:
       index:
         index:   source

+ 25 - 0
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/reindex/10_script.yml → modules/reindex/src/test/resources/rest-api-spec/test/reindex/85_scripting.yml

@@ -433,3 +433,28 @@
   - match:  { docs.2._index:     index2      }
   - match:  { docs.2._type:      type2       }
   - match:  { docs.2._id:        fr_789      }
+
+---
+"Totally broken scripts report the error properly":
+  - do:
+      index:
+        index:  twitter
+        type:   tweet
+        id:     1
+        body:   { "user": "kimchy" }
+  - do:
+      indices.refresh: {}
+
+  - do:
+      catch: request
+      reindex:
+        refresh: true
+        body:
+          source:
+            index: twitter
+          dest:
+            index: new_twitter
+          script:
+            lang: painless
+            source: syntax errors are fun!
+  - match: {error.reason: 'compile error'}

+ 0 - 0
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/reindex/50_reindex_with_parent_join.yml → modules/reindex/src/test/resources/rest-api-spec/test/reindex/95_parent_join.yml


+ 1 - 1
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/update_by_query/40_search_failure.yml → modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/35_search_failure.yml

@@ -1,5 +1,5 @@
 ---
-"Response format search failures":
+"Response format for search failures":
   - do:
       index:
         index:   source

+ 22 - 0
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/update_by_query/10_script.yml → modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/80_scripting.yml

@@ -421,3 +421,25 @@
             term:
               level: 11
   - match: { hits.total: 0 }
+
+---
+"Totally broken scripts report the error properly":
+  - do:
+      index:
+        index:  twitter
+        type:   tweet
+        id:     1
+        body:   { "user": "kimchy" }
+  - do:
+      indices.refresh: {}
+
+  - do:
+      catch: request
+      update_by_query:
+        index:   twitter
+        refresh: true
+        body:
+          script:
+            lang: painless
+            source: syntax errors are fun!
+  - match: {error.reason: 'compile error'}

+ 0 - 26
qa/smoke-test-reindex-with-all-modules/build.gradle

@@ -1,26 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-apply plugin: 'elasticsearch.standalone-rest-test'
-apply plugin: 'elasticsearch.rest-test'
-
-integTestCluster {
-  // Whitelist reindexing from the local node so we can test it.
-  setting 'reindex.remote.whitelist', '127.0.0.1:*'
-}

+ 0 - 37
qa/smoke-test-reindex-with-all-modules/src/test/java/org/elasticsearch/smoketest/SmokeTestReindexWithPainlessClientYamlTestSuiteIT.java

@@ -1,37 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.smoketest;
-
-import com.carrotsearch.randomizedtesting.annotations.Name;
-import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
-
-import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
-import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
-
-public class SmokeTestReindexWithPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
-    public SmokeTestReindexWithPainlessClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
-        super(testCandidate);
-    }
-
-    @ParametersFactory
-    public static Iterable<Object[]> parameters() throws Exception {
-        return ESClientYamlSuiteTestCase.createParameters();
-    }
-}

+ 0 - 24
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/reindex/20_broken.yml

@@ -1,24 +0,0 @@
----
-"Totally broken scripts report the error properly":
-  - do:
-      index:
-        index:  twitter
-        type:   tweet
-        id:     1
-        body:   { "user": "kimchy" }
-  - do:
-      indices.refresh: {}
-
-  - do:
-      catch: request
-      reindex:
-        refresh: true
-        body:
-          source:
-            index: twitter
-          dest:
-            index: new_twitter
-          script:
-            lang: painless
-            source: syntax errors are fun!
-  - match: {error.reason: 'compile error'}

+ 0 - 33
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/reindex/30_timeout.yml

@@ -1,33 +0,0 @@
----
-"Timeout":
-  - skip:
-      version: "all"
-      reason:  painless doesn't support thread.sleep so we need to come up with a better way
-  - do:
-      index:
-        index:  twitter
-        type:   tweet
-        id:     1
-        body:   { "user": "kimchy" }
-  - do:
-      indices.refresh: {}
-
-  - do:
-      catch: request_timeout
-      reindex:
-        refresh: true
-        body:
-          source:
-            index: twitter
-            timeout: 10
-            query:
-              script:
-                lang: painless
-                # Sleep 100x longer than the timeout. That should cause a timeout!
-                # Return true causes the document to try to be collected which is what actually triggers the timeout.
-                script: java.lang.Thread.sleep(1000); return true
-          dest:
-            index: new_twitter
-  - is_true: timed_out
-  - match: {created: 0}
-  - match: {noops: 0}

+ 0 - 21
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/update_by_query/20_broken.yml

@@ -1,21 +0,0 @@
----
-"Totally broken scripts report the error properly":
-  - do:
-      index:
-        index:  twitter
-        type:   tweet
-        id:     1
-        body:   { "user": "kimchy" }
-  - do:
-      indices.refresh: {}
-
-  - do:
-      catch: request
-      update_by_query:
-        index:   twitter
-        refresh: true
-        body:
-          script:
-            lang: painless
-            source: syntax errors are fun!
-  - match: {error.reason: 'compile error'}

+ 0 - 30
qa/smoke-test-reindex-with-all-modules/src/test/resources/rest-api-spec/test/update_by_query/30_timeout.yml

@@ -1,30 +0,0 @@
----
-"Timeout":
-  - skip:
-      version: "all"
-      reason:  painless doesn't support thread.sleep so we need to come up with a better way
-  - do:
-      index:
-        index:  twitter
-        type:   tweet
-        id:     1
-        body:   { "user": "kimchy" }
-  - do:
-      indices.refresh: {}
-
-  - do:
-      catch: request_timeout
-      update_by_query:
-        index:   twitter
-        refresh: true
-        search_timeout: 10ms
-        body:
-          query:
-            script:
-              lang: painless
-              # Sleep 100x longer than the timeout. That should cause a timeout!
-              # Return true causes the document to try to be collected which is what actually triggers the timeout.
-              script: java.lang.Thread.sleep(1000); return true
-  - is_true: timed_out
-  - match: {updated: 0}
-  - match: {noops: 0}