diff --git a/test/run b/test/run index 1988c9b1..2cc49823 100755 --- a/test/run +++ b/test/run @@ -159,13 +159,22 @@ function test_from_dockerfile_s2i() { } app_cleanup() { + info "Cleaning up the test app folders" for server in ${WEB_SERVERS[*]}; do - if [ ! -z "${server}" ]; then + if [[ "${server}" == "db" ]]; then + echo "Removing ${test_dir}/db-test-app" + rm -rf ${test_dir}/db-test-app + elif [ ! -z "${server}" ]; then + echo "Removing ${test_dir}/${server}-test-app/.git" rm -rf ${test_dir}/${server}-test-app/.git fi done - if [[ "${server}" == "db" ]]; then - rm -rf ${test_dir}/db-test-app +} + +function cleanup() { + info "Cleaning up the test application image ${IMAGE_NAME}-testapp" + if image_exists ${IMAGE_NAME}-testapp; then + docker rmi -f ${IMAGE_NAME}-testapp fi } @@ -223,6 +232,8 @@ for server in ${WEB_SERVERS[@]}; do evaluate_build_result $? "$server" || continue TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "$server" + + cleanup done TEST_LIST="test_from_dockerfile test_from_dockerfile_s2i"