From 80871bae2b779f2269abd6c419c0fc7fdad0dba0 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 3 Jul 2015 02:12:01 -0400 Subject: [PATCH] Add simple integ testing infra --- core/pom.xml | 4 ++ .../org/elasticsearch/test/rest/RestIT.java | 38 +++++++++++++++++++ dev-tools/build_release.py | 2 +- pom.xml | 27 ++++++++++++- 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 core/src/test/java/org/elasticsearch/test/rest/RestIT.java diff --git a/core/pom.xml b/core/pom.xml index 7a5f1a631f0..349560df802 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1053,6 +1053,10 @@ + + org.apache.maven.plugins + maven-failsafe-plugin + diff --git a/core/src/test/java/org/elasticsearch/test/rest/RestIT.java b/core/src/test/java/org/elasticsearch/test/rest/RestIT.java new file mode 100644 index 00000000000..167a5f04f92 --- /dev/null +++ b/core/src/test/java/org/elasticsearch/test/rest/RestIT.java @@ -0,0 +1,38 @@ +/* + * 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.test.rest; + +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.elasticsearch.test.rest.parser.RestTestParseException; + +import java.io.IOException; + +/** Rest integration test. runs against external cluster in 'mvn verify' */ +public class RestIT extends ElasticsearchRestTestCase { + public RestIT(RestTestCandidate testCandidate) { + super(testCandidate); + } + // we run them all sequentially: start simple! + @ParametersFactory + public static Iterable parameters() throws IOException, RestTestParseException { + return createParameters(0, 1); + } +} diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py index 32f7b703aa2..526fe335c49 100644 --- a/dev-tools/build_release.py +++ b/dev-tools/build_release.py @@ -466,7 +466,7 @@ def smoke_test_release(release, files, expected_hash, plugins): if version['build_hash'].strip() != expected_hash: raise RuntimeError('HEAD hash does not match expected [%s] but got [%s]' % (expected_hash, version['build_hash'])) print(' Running REST Spec tests against package [%s]' % release_file) - run_mvn('test -Dtests.cluster=%s -Dtests.class=*.*RestTests' % ("127.0.0.1:9300")) + run_mvn('test -Dtests.cluster=%s -Dtests.jvms=1 -Dtests.class=*.*RestTests' % ("127.0.0.1:9300")) print(' Verify if plugins are listed in _nodes') conn.request('GET', '/_nodes?plugin=true&pretty=true') res = conn.getresponse() diff --git a/pom.xml b/pom.xml index b637996bb0e..e8f020ce00b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ + UTF-8 2.0.0-SNAPSHOT ${java.home}${file.separator}bin${file.separator}java @@ -101,6 +102,8 @@ true fail + ${skipTests} + ${skipTests} @@ -570,6 +573,7 @@ ${jvm.executable} ${tests.jvm.argline} + ${skip.unit.tests} 10 warn true @@ -701,6 +705,27 @@ true + + org.apache.maven.plugins + maven-failsafe-plugin + 2.18.1 + + ${skip.integ.tests} + + ${es.logger.level} + + + + + run-tests + integration-test + + integration-test + verify + + + + org.apache.maven.plugins maven-source-plugin @@ -1239,7 +1264,7 @@ org.eclipse.jdt.ui.text.custom_code_templates=tests-top-hints test - ${skipTests} + ${skip.unit.tests} false