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
This commit is contained in:
Mehdi Abaakouk 2013-07-09 15:29:43 +00:00
parent 048c59c930
commit b3ebef4e92
2 changed files with 12 additions and 5 deletions

View File

@ -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

View File

@ -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