From b3ebef4e92cdfdfb9ce8c51dff597092cd410f82 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Tue, 9 Jul 2013 15:29:43 +0000 Subject: [PATCH] Use run-tests.sh for tox coverage tests The coverage tests mustn't run in parallel and must have a working mongod instance like other tests. So just use the run-tests.sh with a special flags --coverage Fix bug #1199411 Change-Id: Id750697a69213ee753280b7adc8f726dbdb1fca5 --- run-tests.sh | 15 +++++++++++---- tox.ini | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 12d9e6613..657cdbb73 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,9 +1,16 @@ #!/bin/bash set -e -# Nova notifier tests -bash tools/init_testr_if_needed.sh -python setup.py testr --slowest --testr-args="--concurrency=1 --here=nova_tests $*" +if [ "$1" = "--coverage" ]; then + COVERAGE_ARG="$1" + shift +fi + +if [ ! "$COVERAGE_ARGS" ]; then + # Nova notifier tests + bash tools/init_testr_if_needed.sh + python setup.py testr --slowest --testr-args="--concurrency=1 --here=nova_tests $*" +fi # Main unit tests MONGO_DATA=`mktemp -d` @@ -12,4 +19,4 @@ mongod --maxConns 32 --smallfiles --quiet --noauth --port 29000 --dbpath "${MONG MONGO_PID=$! trap "kill -9 ${MONGO_PID} || true" EXIT export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:29000/ceilometer" -python setup.py testr --slowest --testr-args="--concurrency=1 $*" +python setup.py testr --slowest --testr-args="--concurrency=1 $*" $COVERAGE_ARG diff --git a/tox.ini b/tox.ini index 141ccd028..99a876d14 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ downloadcache = {toxworkdir}/_download [testenv:cover] setenv = VIRTUAL_ENV={envdir} -commands = python setup.py testr --coverage +commands = bash -x {toxinidir}/run-tests.sh --coverage [testenv:pep8] # Install bounded pep8/pyflakes first, then let flake8 install