Add integration tests for distribution/deb

This commit is contained in:
Robert Muir 2015-07-29 21:34:46 -04:00
parent 1c5a558164
commit 2ed8e697d5
7 changed files with 111 additions and 5 deletions

View File

@ -198,4 +198,28 @@
<startup-elasticsearch/>
</target>
<!-- distribution tests: .deb -->
<target name="setup-workspace-deb" depends="stop-external-cluster" unless="${shouldskip}">
<sequential>
<delete dir="${integ.scratch}"/>
<mkdir dir="${integ.scratch}/deb-extracted"/>
<local name="debfile"/>
<property name="debfile" location="${project.build.directory}/releases/elasticsearch-${project.version}.deb"/>
<exec executable="dpkg-deb" failonerror="true" taskname="deb-info">
<arg value="-W"/>
<arg value="${debfile}"/>
</exec>
<exec executable="dpkg-deb" failonerror="true">
<arg value="-x"/>
<arg value="${debfile}"/>
<arg value="${integ.scratch}/deb-extracted"/>
</exec>
</sequential>
</target>
<target name="start-external-cluster-deb" depends="setup-workspace-deb" unless="${shouldskip}">
<startup-elasticsearch home="${integ.scratch}/deb-extracted/usr/share/elasticsearch/"/>
</target>
</project>

View File

@ -10,11 +10,9 @@
</parent>
<artifactId>elasticsearch-deb</artifactId>
<packaging>deb</packaging>
<name>Elasticsearch DEB Distribution</name>
<properties>
<skip.integ.tests>true</skip.integ.tests>
<deb.sign>false</deb.sign>
<deb.sign.method>dpkg-sig</deb.sign.method>
</properties>
@ -273,8 +271,49 @@
</target>
</configuration>
</execution>
<!-- start up external cluster -->
<execution>
<id>integ-setup</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-deb"/>
</target>
</configuration>
</execution>
<!-- shut down external cluster -->
<execution>
<id>integ-teardown</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="stop-external-cluster"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- we run integration test with real dpkg utils, you must have them -->
<profile>
<id>has_dpkg</id>
<activation>
<file><missing>/usr/bin/dpkg-deb</missing></file>
</activation>
<properties>
<skip.integ.tests>true</skip.integ.tests>
</properties>
</profile>
</profiles>
</project>

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

@ -15,7 +15,6 @@
<name>Elasticsearch Distribution</name>
<properties>
<skipTests>true</skipTests>
<!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
<packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
<packaging.elasticsearch.bin.dir>/usr/share/elasticsearch/bin</packaging.elasticsearch.bin.dir>
@ -32,6 +31,9 @@
<!-- rpmbuild location : default to /usr/bin/rpmbuild -->
<packaging.rpm.rpmbuild>/usr/bin/rpmbuild</packaging.rpm.rpmbuild>
<!-- we expect packaging formats to have integration tests, but not unit tests -->
<skip.unit.tests>true</skip.unit.tests>
</properties>
<dependencies>

View File

@ -13,7 +13,6 @@
<name>Elasticsearch TAR Distribution</name>
<properties>
<skip.integ.tests>false</skip.integ.tests>
</properties>
<build>
@ -77,6 +76,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster-tar"/>
</target>
@ -90,6 +90,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="stop-external-cluster"/>
</target>

View File

@ -90,6 +90,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="start-external-cluster"/>
</target>
@ -103,6 +104,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${skip.integ.tests}</skip>
<target>
<ant antfile="${elasticsearch.integ.antfile}" target="stop-external-cluster"/>
</target>

View File

@ -1332,7 +1332,7 @@ org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UT
<activation>
<activeByDefault>false</activeByDefault>
<file>
<missing>${basedir}/src</missing>
<missing>${basedir}/src/test/java</missing>
</file>
</activation>
<properties>