diff --git a/tests/bin/run-tests-docker.sh b/tests/bin/run-tests-docker.sh index afcd42c22..84c7de19f 100755 --- a/tests/bin/run-tests-docker.sh +++ b/tests/bin/run-tests-docker.sh @@ -1,10 +1,11 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + set -eu unset CDPATH -cd "$( dirname "${BASH_SOURCE[0]}" )/../.." +cd "$( dirname "$0" )/../.." -function usage() { +usage() { cat >&2 < 0 ]]; do + while [ $# -gt 0 ]; do case "$1" in -B|--no-build) DOCKER_BUILD=false; ;; -h|--help) usage; exit 0 ;; @@ -56,14 +57,14 @@ function main() { -e SCITRAN_PERSISTENT_DB_URI=mongodb://scitran-core-test-mongo:27017/scitran \ -e SCITRAN_PERSISTENT_DB_LOG_URI=mongodb://scitran-core-test-mongo:27017/logs \ -v $(pwd):/var/scitran/code/api \ - --entrypoint bash \ + --entrypoint sh \ scitran-core:run-tests \ /var/scitran/code/api/tests/bin/run-tests-ubuntu.sh \ $TEST_ARGS } -function clean_up() { +clean_up() { local TEST_RESULT_CODE=$? set +e diff --git a/tests/bin/run-tests-ubuntu.sh b/tests/bin/run-tests-ubuntu.sh index 8c7d94fa5..00af432d1 100755 --- a/tests/bin/run-tests-ubuntu.sh +++ b/tests/bin/run-tests-ubuntu.sh @@ -1,10 +1,11 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + set -eu unset CDPATH cd "$( dirname "${BASH_SOURCE[0]}" )/../.." -function usage() { +usage() { cat >&2 < 0 ]]; do + while [ $# -gt 0 ]; do case "$1" in -l|--lint) RUN_ALL=false; RUN_LINT=true ;; -u|--unit) RUN_ALL=false; RUN_UNIT=true ;; @@ -158,14 +159,14 @@ function main() { } -function clean_up () { +clean_up() { local TEST_RESULT_CODE=$? set +e echo echo "Test return code = $TEST_RESULT_CODE" - if [[ -n "${API_PID:-}" ]]; then + if [ "${API_PID:-}" ]; then # Killing uwsgi kill $API_PID wait 2> /dev/null