Skip to content

Commit

Permalink
Add tomcat 7 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ProTip committed Mar 7, 2019
1 parent 6f61eb5 commit 91f7d7d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,16 @@ jobs:
- script_block 'docker.pull' pull_rdtest
- script_block 'api-test' 'DOCKER_COMPOSE_SPEC=docker-compose-api-mysql.yaml bash test/run-docker-api-tests.sh'

- env: JOB='Docker Tomcat API tests'
- env: JOB='Docker Tomcat 8 API tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'api-test' 'bash test/run-docker-tomcat-tests.sh'

- env: JOB='Docker Tomcat 7 API tests'
script:
- script_block 'sync-artifacts' fetch_common_artifacts
- script_block 'api-test' 'bash test/run-docker-tomcat-tests.sh 7-jre8'

- stage: test
env: JOB='Test deb install'
script:
Expand Down
4 changes: 3 additions & 1 deletion test/docker/dockers/tomcat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM tomcat:8
ARG TOMCAT_TAG

FROM tomcat:${TOMCAT_TAG:-8}

RUN apt-get update && \
apt-get -y install coreutils file jq netcat xmlstarlet
Expand Down
3 changes: 3 additions & 0 deletions test/docker/test-api-tomcat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -euo pipefail

. common.sh

TOMCAT_TAG="${1}"

# Sets the compose file to use for test run
# Different compose files used for different environments
export DOCKER_COMPOSE_SPEC=${DOCKER_COMPOSE_SPEC:-docker-compose-tomcat-test.yml}
Expand All @@ -28,6 +30,7 @@ cp -r ../api dockers/tomcat/api_test/
docker build \
-t rd-tomcat:latest \
--cache-from rdtest:latest \
--build-arg TOMCAT_TAG=$TOMCAT_TAG \
--build-arg LAUNCHER_URL=$LAUNCHER_URL \
--build-arg CLI_DEB_URL=$CLI_DEB_URL \
--build-arg CLI_VERS=$CLI_VERS \
Expand Down
11 changes: 3 additions & 8 deletions test/run-docker-tomcat-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ IFS=$'\n\t'
readonly ARGS=("$@")
DOCKER_DIR=$PWD/test/docker

TOMCAT_TAG="${1:-8}"

usage() {
grep '^#/' <"$0" | cut -c4- # prints the #/ lines above as usage info
}
die(){
echo >&2 "$@" ; exit 2
}

check_args(){
if [ ${#ARGS[@]} -gt 0 ] ; then
DOCKER_DIR=$1
fi
}

copy_jar(){
local FARGS=("$@")
local DIR=${FARGS[0]}
Expand All @@ -34,7 +30,7 @@ run_tests(){
local DIR=${FARGS[0]}

cd $DIR
bash $DIR/test-api-tomcat.sh
bash $DIR/test-api-tomcat.sh $TOMCAT_TAG
}

run_docker_test(){
Expand All @@ -46,7 +42,6 @@ run_docker_test(){


main() {
check_args
run_docker_test $DOCKER_DIR
}
main

0 comments on commit 91f7d7d

Please sign in to comment.