Add simple integ testing infra

This commit is contained in:
Robert Muir 2015-07-03 02:12:01 -04:00
parent 3084bed194
commit 80871bae2b
4 changed files with 69 additions and 2 deletions

View File

@ -1053,6 +1053,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>

View File

@ -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<Object[]> parameters() throws IOException, RestTestParseException {
return createParameters(0, 1);
}
}

View File

@ -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()

27
pom.xml
View File

@ -33,6 +33,7 @@
</scm>
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- elasticsearch stack -->
<elasticsearch.version>2.0.0-SNAPSHOT</elasticsearch.version>
<jvm.executable>${java.home}${file.separator}bin${file.separator}java</jvm.executable>
@ -101,6 +102,8 @@
<tests.security.manager>true</tests.security.manager>
<tests.compatibility></tests.compatibility>
<tests.ifNoTests>fail</tests.ifNoTests>
<skip.unit.tests>${skipTests}</skip.unit.tests>
<skip.integ.tests>${skipTests}</skip.integ.tests>
</properties>
<repositories>
@ -570,6 +573,7 @@
<configuration>
<jvm>${jvm.executable}</jvm>
<argLine>${tests.jvm.argline}</argLine>
<skipTests>${skip.unit.tests}</skipTests>
<heartbeat>10</heartbeat>
<jvmOutputAction>warn</jvmOutputAction>
<leaveTemporary>true</leaveTemporary>
@ -701,6 +705,27 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<skipTests>${skip.integ.tests}</skipTests>
<systemPropertyVariables>
<es.logger.level>${es.logger.level}</es.logger.level>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>run-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -1239,7 +1264,7 @@ org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UT
<id>tests-top-hints</id>
<phase>test</phase>
<configuration>
<skip>${skipTests}</skip>
<skip>${skip.unit.tests}</skip>
<!-- don't run if we skip the tests -->
<failOnError>false</failOnError>
<target>