aodh/run-tests.sh
Mehdi Abaakouk b3ebef4e92 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
2013-07-15 17:45:10 +02:00

23 lines
656 B
Bash
Executable File

#!/bin/bash
set -e
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`
trap "rm -rf ${MONGO_DATA}" EXIT
mongod --maxConns 32 --smallfiles --quiet --noauth --port 29000 --dbpath "${MONGO_DATA}" --bind_ip localhost &
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 $*" $COVERAGE_ARG