From cb86cf5d1a41ef728cf3451c134949ece0a15cad Mon Sep 17 00:00:00 2001 From: Riyaz Faizullabhoy Date: Tue, 12 Apr 2016 10:58:15 -0700 Subject: [PATCH] Add additional check and cleanups to integration test Signed-off-by: Riyaz Faizullabhoy --- buildscripts/rethinkdbintegrationtest.sh | 15 ++++++++++++++- buildscripts/testclient.sh | 2 +- development.rethink.yml | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/buildscripts/rethinkdbintegrationtest.sh b/buildscripts/rethinkdbintegrationtest.sh index 767f12ccac..69935ec5c1 100755 --- a/buildscripts/rethinkdbintegrationtest.sh +++ b/buildscripts/rethinkdbintegrationtest.sh @@ -8,6 +8,18 @@ function cleanup { fi } +function cleanupAndExit { + cleanup + # Check for existence of SUCCESS + ls test_output/SUCCESS + exitCode=$? + # Clean up test_output dir (if not in CircleCI) and exit + if [[ -z "${CIRCLECI}" ]]; then + rm -rf test_output + fi + exit $exitCode +} + if [[ -z "${CIRCLECI}" ]]; then BUILDOPTS="--force-rm" fi @@ -17,7 +29,8 @@ set -x cleanup +docker-compose -f development.rethink.yml config docker-compose -f development.rethink.yml build ${BUILDOPTS} --pull | tee docker-compose -f development.rethink.yml up --abort-on-container-exit -trap cleanup SIGINT SIGTERM EXIT +trap cleanupAndExit SIGINT SIGTERM EXIT diff --git a/buildscripts/testclient.sh b/buildscripts/testclient.sh index f5bbe6f692..10fae60af6 100755 --- a/buildscripts/testclient.sh +++ b/buildscripts/testclient.sh @@ -47,4 +47,4 @@ bin/notary ${OPTS} delegation list ${REPONAME} | grep targets/releases cat README.md | bin/notary ${OPTS} verify $REPONAME readmetarget > /test_output/SUCCESS # Make this file accessible for CI -chmod 777 /test_output/SUCCESS +chmod -R 777 /test_output diff --git a/development.rethink.yml b/development.rethink.yml index 7ec437c1ed..2559c852e0 100644 --- a/development.rethink.yml +++ b/development.rethink.yml @@ -78,6 +78,10 @@ services: - rdb-01 - rdb-02 client: + volumes: + - ./test_output:/test_output + networks: + - rdb build: context: . dockerfile: Dockerfile