Merge "Refactored run-tests script"

This commit is contained in:
Jenkins 2014-02-11 17:10:08 +00:00 committed by Gerrit Code Review
commit dcf81c3b5a
2 changed files with 7 additions and 11 deletions

View File

@ -8,12 +8,7 @@ function clean_exit(){
return $error_code
}
if [ "$1" = "--coverage" ]; then
COVERAGE_ARG="$1"
shift
fi
# Main unit tests
# Setup MongoDB test server
MONGO_DATA=`mktemp -d /tmp/CEILO-MONGODB-XXXXX`
MONGO_PORT=29000
trap "clean_exit" EXIT
@ -31,7 +26,8 @@ do
echo "$line" | grep -q "waiting for connections on port ${MONGO_PORT}" && break
done < ${MONGO_DATA}/out
# Read the fifo for ever otherwise mongod would block
# + that gives us the log on screen
cat ${MONGO_DATA}/out > /dev/null &
export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:${MONGO_PORT}/ceilometer"
python setup.py testr --slowest --testr-args="$*" $COVERAGE_ARG
# Yield execution to venv command
$*

View File

@ -11,13 +11,13 @@ usedevelop = True
setenv = VIRTUAL_ENV={envdir}
EVENTLET_NO_GREENDNS=yes
commands =
bash -x {toxinidir}/run-tests.sh {posargs}
bash -x {toxinidir}/setup-test-env.sh python setup.py testr --slowest --testr-args="{posargs}"
{toxinidir}/tools/config/check_uptodate.sh
downloadcache = {toxworkdir}/_download
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
commands = bash -x {toxinidir}/run-tests.sh --coverage
commands = bash -x {toxinidir}/setup-test-env.sh python setup.py testr --slowest --coverage --testr-args="{posargs}"
[testenv:pep8]
# Install bounded pep8/pyflakes first, then let flake8 install
@ -37,7 +37,7 @@ commands = python setup.py build_sphinx
[testenv:venv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = {posargs}
commands = bash -x {toxinidir}/setup-test-env.sh {posargs}
[flake8]
ignore = None