From 1c114110c543867e529960b4b5fb188c4edef165 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 6 Jul 2015 12:29:30 -0400 Subject: [PATCH 1/5] integration tests need the zip --- plugins/pom.xml | 6 ++++++ pom.xml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/plugins/pom.xml b/plugins/pom.xml index 1ffeb6bce29..51966f84c33 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -40,6 +40,12 @@ test-jar test + + org.elasticsearch + elasticsearch + zip + test + diff --git a/pom.xml b/pom.xml index ba5ecff87d0..0a642164b6c 100644 --- a/pom.xml +++ b/pom.xml @@ -188,6 +188,13 @@ test-jar + + org.elasticsearch + elasticsearch + ${elasticsearch.version} + zip + + org.apache.httpcomponents httpclient From 7595104ec3fb7f574d0b49f742a1f51c5632ccdf Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 6 Jul 2015 13:59:16 -0400 Subject: [PATCH 2/5] Factor integration tests logic to separate build file --- core/pom.xml | 57 ++------------- .../main/resources/ant/integration-tests.xml | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+), 53 deletions(-) create mode 100644 dev-tools/src/main/resources/ant/integration-tests.xml diff --git a/core/pom.xml b/core/pom.xml index b6f99958d5f..d958fcee41a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1038,34 +1038,8 @@ - - - - - - - - - - - Starting up external cluster... - - - - - - - - - - - - - External cluster started + @@ -1078,31 +1052,8 @@ - - - - - - - - - - - - - - Shutting down external cluster - - - - - - - - - - - + diff --git a/dev-tools/src/main/resources/ant/integration-tests.xml b/dev-tools/src/main/resources/ant/integration-tests.xml new file mode 100644 index 00000000000..15b86e6f35f --- /dev/null +++ b/dev-tools/src/main/resources/ant/integration-tests.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + Starting up external cluster... + + + + + + + + + + + + + + + + + External cluster started + + + + + + + + + + + + + + + + + + Shutting down external cluster + + + + + + + + + + + + + + + From 75285cee8880dc75af3f78e1f4c6ef7abcc7cf55 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 6 Jul 2015 14:19:28 -0400 Subject: [PATCH 3/5] factor out this helper --- .../main/resources/ant/integration-tests.xml | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/dev-tools/src/main/resources/ant/integration-tests.xml b/dev-tools/src/main/resources/ant/integration-tests.xml index 15b86e6f35f..c6e082a71e5 100644 --- a/dev-tools/src/main/resources/ant/integration-tests.xml +++ b/dev-tools/src/main/resources/ant/integration-tests.xml @@ -1,6 +1,24 @@ + + + + + + + + + + + + + + + + + + @@ -18,16 +36,7 @@ Starting up external cluster... - - - - - - - - - - + From 9a146b9e75992fd92a18dfe170447e5a0562222e Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 6 Jul 2015 15:13:50 -0400 Subject: [PATCH 4/5] Get delete by query rest tests running --- .../main/resources/ant/integration-tests.xml | 46 +++++++++++++++--- .../test/rest/DeleteByQueryRestIT.java | 41 ++++++++++++++++ plugins/pom.xml | 47 +++++++++++++++++++ pom.xml | 6 ++- 4 files changed, 132 insertions(+), 8 deletions(-) create mode 100644 plugins/delete-by-query/src/test/java/org/elasticsearch/plugin/deletebyquery/test/rest/DeleteByQueryRestIT.java diff --git a/dev-tools/src/main/resources/ant/integration-tests.xml b/dev-tools/src/main/resources/ant/integration-tests.xml index c6e082a71e5..8bc8a515e45 100644 --- a/dev-tools/src/main/resources/ant/integration-tests.xml +++ b/dev-tools/src/main/resources/ant/integration-tests.xml @@ -1,42 +1,74 @@ + + - + - + - + + - - + + -Des.script.indexed=on -Des.path.repo=${integ.repo.home}"/> + Starting up external cluster... + - + + + + + External cluster started + + + + + + + + + + + + + + + Installing plugin ${project.artifactId}... + + + + Starting up external cluster... + diff --git a/plugins/delete-by-query/src/test/java/org/elasticsearch/plugin/deletebyquery/test/rest/DeleteByQueryRestIT.java b/plugins/delete-by-query/src/test/java/org/elasticsearch/plugin/deletebyquery/test/rest/DeleteByQueryRestIT.java new file mode 100644 index 00000000000..ec3931fd875 --- /dev/null +++ b/plugins/delete-by-query/src/test/java/org/elasticsearch/plugin/deletebyquery/test/rest/DeleteByQueryRestIT.java @@ -0,0 +1,41 @@ +/* + * 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.plugin.deletebyquery.test.rest; + +import com.carrotsearch.randomizedtesting.annotations.Name; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.test.rest.ElasticsearchRestTestCase; +import org.elasticsearch.test.rest.RestTestCandidate; +import org.elasticsearch.test.rest.parser.RestTestParseException; + +import java.io.IOException; + +public class DeleteByQueryRestIT extends ElasticsearchRestTestCase { + + public DeleteByQueryRestIT(@Name("yaml") RestTestCandidate testCandidate) { + super(testCandidate); + } + + @ParametersFactory + public static Iterable parameters() throws IOException, RestTestParseException { + return ElasticsearchRestTestCase.createParameters(0, 1); + } +} + diff --git a/plugins/pom.xml b/plugins/pom.xml index 51966f84c33..352706a852f 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -288,6 +288,53 @@ + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + integ-setup + pre-integration-test + + run + + + + + + + + + + integ-teardown + post-integration-test + + run + + + + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + 127.0.0.1:9300 + + + + + diff --git a/pom.xml b/pom.xml index a339908c080..f6eff4385dd 100644 --- a/pom.xml +++ b/pom.xml @@ -94,10 +94,10 @@ + - true @@ -701,6 +701,10 @@ ${skip.integ.tests} ${es.logger.level} + ${tests.rest.suite} + ${tests.rest.blacklist} + ${tests.rest.spec} + ${tests.rest.load_packaged} From 23dfb5f1a5208970c6c008370e54afd1cd5ef520 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 6 Jul 2015 15:49:57 -0400 Subject: [PATCH 5/5] don't try to run tests for packaging=pom --- dev-tools/src/main/resources/ant/integration-tests.xml | 9 +++++++-- pom.xml | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dev-tools/src/main/resources/ant/integration-tests.xml b/dev-tools/src/main/resources/ant/integration-tests.xml index 8bc8a515e45..d3554571ca5 100644 --- a/dev-tools/src/main/resources/ant/integration-tests.xml +++ b/dev-tools/src/main/resources/ant/integration-tests.xml @@ -1,6 +1,11 @@ + + + + + @@ -22,7 +27,7 @@ - + @@ -48,7 +53,7 @@ - +