summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-25 18:30:26 +0000
committerGerrit Code Review <review@openstack.org>2013-02-25 18:30:26 +0000
commit73a58f9cc85bf8d7fc745d4260577d764e8bc81c (patch)
tree34efd17b3ce33faf0928d4731a77d9bb940261be
parent2f90562818abb8e272142e7a3b84393943419de7 (diff)
parentd923921d1277a21d2a80539a72dda4d56d4f36eb (diff)
downloadnova-73a58f9cc85bf8d7fc745d4260577d764e8bc81c.tar.gz
nova-73a58f9cc85bf8d7fc745d4260577d764e8bc81c.tar.xz
nova-73a58f9cc85bf8d7fc745d4260577d764e8bc81c.zip
Merge "Readd run_tests.sh --debug option."
-rwxr-xr-xrun_tests.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh
index 9872858b4..2b6eda900 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -16,6 +16,7 @@ function usage {
echo " -p, --pep8 Just run PEP8 and HACKING compliance check"
echo " -P, --no-pep8 Don't run static code checks"
echo " -c, --coverage Generate coverage report"
+ echo " -d, --debug Run tests with testtools instead of testr. This allows you to use the debugger."
echo " -h, --help Print this usage message"
echo " --hide-elapsed Don't print the elapsed time for each test along with slow test list"
echo " --virtual-env-path <path> Location of the virtualenv directory"
@@ -46,6 +47,7 @@ function process_options {
-p|--pep8) just_pep8=1;;
-P|--no-pep8) no_pep8=1;;
-c|--coverage) coverage=1;;
+ -d|--debug) debug=1;;
--virtual-env-path)
(( i++ ))
venv_path=${!i}
@@ -80,6 +82,7 @@ wrapper=""
just_pep8=0
no_pep8=0
coverage=0
+debug=0
recreate_db=1
update=0
@@ -109,6 +112,20 @@ function run_tests {
# Cleanup *pyc
${wrapper} find . -type f -name "*.pyc" -delete
+ if [ $debug -eq 1 ]; then
+ if [ "$testropts" = "" ] && [ "$testrargs" = "" ]; then
+ # Default to running all tests if specific test is not
+ # provided.
+ testrargs="discover ./nova/tests"
+ fi
+ ${wrapper} python -m testtools.run $testropts $testrargs
+
+ # Short circuit because all of the testr and coverage stuff
+ # below does not make sense when running testtools.run for
+ # debugging purposes.
+ return $?
+ fi
+
if [ $coverage -eq 1 ]; then
# Do not test test_coverage_ext when gathering coverage.
if [ "x$testrargs" = "x" ]; then