diff options
author | Chuck Short <chuck.short@canonical.com> | 2012-11-07 18:45:03 -0600 |
---|---|---|
committer | Chuck Short <chuck.short@canonical.com> | 2012-11-27 07:49:33 -0600 |
commit | 6f562bbe09b06fe541c22ffb2bd4ad7111e7d664 (patch) | |
tree | 1f85dc176c0c1eed667774fab5617e85d4c78fe7 /run_tests.sh | |
parent | e4f1a70c37352730a4fa1b7466e526e1f3b168ed (diff) | |
download | nova-6f562bbe09b06fe541c22ffb2bd4ad7111e7d664.tar.gz |
Display errors when running nosetests
During Ubuntu builds we run the run_test.sh script
during the package build process, so that we can catch
regressions in our packaging before uploading to the archive.
However a recent change writes the output of the nosetests
to an error log so we don't see why the package fail to build.
This patch also displays the output of the nosetests so we
can see why the tests fail without having to look at the nosetests.log.
This patch add the '-v', for a verbose display of nosetests.
Change-Id: Id21d53df356de344a8577282c5a82f3ff927bc11
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/run_tests.sh b/run_tests.sh index 5028adb0ae..b251787660 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -17,6 +17,7 @@ function usage { echo " -P, --no-pep8 Don't run static code checks" echo " -c, --coverage Generate coverage report" echo " -h, --help Print this usage message" + echo " -v, --verbose Display nosetests in the console" echo " --hide-elapsed Don't print the elapsed time for each test along with slow test list" echo "" echo "Note: with no options specified, the script will try to run the tests in a virtual environment," @@ -39,6 +40,7 @@ function process_option { -p|--pep8) just_pep8=1;; -P|--no-pep8) no_pep8=1;; -c|--coverage) coverage=1;; + -v|--verbose) verbose=1;; -*) noseopts="$noseopts $1";; *) noseargs="$noseargs $1" esac @@ -59,6 +61,7 @@ no_pep8=0 coverage=0 recreate_db=1 patch_migrate=1 +verbose=0 export NOSE_WITH_OPENSTACK=1 export NOSE_OPENSTACK_COLOR=1 @@ -88,7 +91,13 @@ function run_tests { # Cleanup *pyc ${wrapper} find . -type f -name "*.pyc" -delete # Just run the test suites in current environment - ${wrapper} $NOSETESTS | tee nosetests.log + if [ "$verbose" -eq 1 ]; + then + ${wrapper} $NOSETESTS 2>&1 | tee nosetests.log + else + ${wrapper} $NOSETESTS | tee nosetests.log + fi + # If we get some short import error right away, print the error log directly RESULT=$? if [ "$RESULT" -ne "0" ]; |