Skip to content

Commit

Permalink
Add Lucene-Solr nightly smoke test in third party container test buck…
Browse files Browse the repository at this point in the history
…et (#392)

Add Lucene-Solr standard test suite to External Tests
  • Loading branch information
Mesbah-Alam authored Apr 26, 2018
1 parent cf9f9cf commit da5e4f3
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 1 deletion.
2 changes: 1 addition & 1 deletion thirdparty_containers/example-test/dockerfile/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This Dockerfile in thirdpart_containers/scala/dockerfile dir is used to create an image with
# This Dockerfile in thirdparty_containers/example-test/dockerfile dir is used to create an image with
# AdoptOpenJDK jdk binary installed. Basic test dependent executions
# are installed during the building process.
#
Expand Down
38 changes: 38 additions & 0 deletions thirdparty_containers/lucene-solr/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<project name="lucene-solr-test" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Build lucene-solr-test Docker image
</description>

<!-- set properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/thirdparty_containers/lucene-solr-test" />
<property name="src" location="." />
<property name="jvm_version" location="${JVM_VERSION}" />

<target name="init">
<mkdir dir="${DEST}"/>
</target>

<target name="clean_image" depends="init" description="clean lucene-solr test docker image if there is one">
<exec executable="docker">
<arg line="rmi -f adoptopenjdk-lucene-solr-test" />
</exec>
</target>

<target name="build_image" depends="clean_image" description="build lucene-solr test docker image">
<exec executable="docker" failonerror="true">
<arg line="build -t adoptopenjdk-lucene-solr-test -f dockerfile/Dockerfile --pull . --build-arg SDK=${JVM_VERSION}" />
</exec>
</target>

<target name="dist" depends="build_image" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml, *.mk"/>
</copy>
</target>

<target name="build">
<antcall target="dist" inheritall="true" />
</target>
</project>
80 changes: 80 additions & 0 deletions thirdparty_containers/lucene-solr/dockerfile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Licensed 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.

# This Dockerfile in thirdparty_containers/lucene-solr/dockerfile dir is used to create an image with
# AdoptOpenJDK jdk binary installed. Basic test dependent executions
# are installed during the building process.
#
# Build example: `docker build -t adoptopenjdk-lucene-solr-test .`
#
# This Dockerfile builds image based on adoptopenjdk/openjdk8:latest.
# If you want to build image based on other images, please use
# `--build-arg list` to specify your base image
#
# Build example: `docker build --build-arg IMAGE_NAME=<image_name> --build-arg IMAGE_VERSION=<image_version> -t adoptopenjdk-lucene-solr-test .`

ARG SDK=openjdk8
ARG IMAGE_NAME=adoptopenjdk/$SDK
ARG IMAGE_VERSION=latest

FROM $IMAGE_NAME:$IMAGE_VERSION

# Install test dependent executable files
RUN apt-get update \
&& apt-get -y install \
ant \
apt-transport-https \
ca-certificates \
dirmngr \
curl \
git \
make \
unzip \
vim \
wget \
python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip

WORKDIR /
ENV LUCENE_SOLR_HOME ${WORKDIR}

#apache ant setup
ENV ANT_VERSION 1.10.3
RUN wget --no-check-certificate https://www.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
gunzip apache-ant-${ANT_VERSION}-bin.tar.gz && \
tar -xvf apache-ant-${ANT_VERSION}-bin.tar

#apache ivy setup
ENV IVY_VERSION 2.4.0
RUN wget http://archive.apache.org/dist/ant/ivy/${IVY_VERSION}/apache-ivy-${IVY_VERSION}-bin.tar.gz && \
gunzip apache-ivy-${IVY_VERSION}-bin.tar.gz && \
tar -xvf apache-ivy-${IVY_VERSION}-bin.tar && \
cp apache-ivy-${IVY_VERSION}/ivy-${IVY_VERSION}.jar $WORKDIR/apache-ant-${ANT_VERSION}/lib/
ENV ANT_HOME ${WORKDIR}/apache-ant-${ANT_VERSION}

VOLUME ["/java"]
ENV JAVA_HOME=/java \
PATH=/java/bin:$PATH \
JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"


COPY ./dockerfile/lucene-solr-test.sh /lucene-solr-test.sh

# Clone the repo where the Lucen-Solr code and tests reside.

RUN pwd
RUN git clone https://github.com/apache/lucene-solr.git

ENTRYPOINT ["/bin/bash", "/lucene-solr-test.sh"]
CMD ["--version"]
52 changes: 52 additions & 0 deletions thirdparty_containers/lucene-solr/dockerfile/lucene-solr-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#/bin/bash
# Licensed 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.
#

if [ -d /java/jre/bin ];then
echo "Using mounted Java8"
export JAVA_BIN=/java/jre/bin
export JAVA_HOME=/java
export PATH=$JAVA_BIN:$PATH
java -version
elif [ -d /java/bin ]; then
echo "Using mounted Java9"
export JAVA_BIN=/java/bin
export JAVA_HOME=/java
export PATH=$JAVA_BIN:$PATH
java -version
else
echo "Using docker image default Java"
java_path=$(type -p java)
suffix="/java"
java_root=${java_path%$suffix}
export JAVA_BIN="$java_root"
echo "JAVA_BIN is: $JAVA_BIN"
$JAVA_BIN/java -version
fi

TEST_SUITE=$1

echo "PATH is : $PATH"
echo "JAVA_HOME is : $JAVA_HOME"
echo "ANT_HOME is: $ANT_HOME"
echo "type -p java is :"
type -p java
echo "java -version is: \n"
java -version
cd ${LUCENE_SOLR_HOME}/lucene-solr
ls .
pwd
echo "Compile and execute lucene-solr test" && \
${ANT_HOME}/bin/ant -Divy_install_path=${ANT_HOME}/lib -lib ${ANT_HOME}/lib ivy-bootstrap && \
${ANT_HOME}/bin/ant -Divy_install_path=${ANT_HOME}/lib -lib ${ANT_HOME}/lib -f ${LUCENE_SOLR_HOME}/lucene-solr/build.xml -Duser.home=${LUCENE_SOLR_HOME} -Dcommon.dir=${LUCENE_SOLR_HOME}/lucene-solr/lucene compile && \
${ANT_HOME}/bin/ant -Divy_install_path=${ANT_HOME}/lib -lib ${ANT_HOME}/lib -f ${LUCENE_SOLR_HOME}/lucene-solr/build.xml -Duser.home=${LUCENE_SOLR_HOME} -Dcommon.dir=${LUCENE_SOLR_HOME}/lucene-solr/lucene test
31 changes: 31 additions & 0 deletions thirdparty_containers/lucene-solr/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
# Licensed 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.
-->
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../TestConfig/playlist.xsd">
<test>
<testCaseName>lucene_solr_nightly_smoketest</testCaseName>
<command>docker run --rm -v $(JDK_HOME):/java adoptopenjdk-lucene-solr-test:latest ; \
$(TEST_STATUS)</command>
<subsets>
<subset>SE80</subset>
<subset>SE90</subset>
</subsets>
<levels>
<level>extended</level>
</levels>
<groups>
<group>external</group>
</groups>
</test>
</playlist>

0 comments on commit da5e4f3

Please sign in to comment.