Merge "Make run_tests.sh fail if no tests are actually run"

This commit is contained in:
Jenkins
2012-10-12 21:06:53 +00:00
committed by Gerrit Code Review

View File

@@ -88,7 +88,7 @@ function run_tests {
# Cleanup *pyc
${wrapper} find . -type f -name "*.pyc" -delete
# Just run the test suites in current environment
${wrapper} $NOSETESTS
${wrapper} $NOSETESTS | tee nosetests.log
# If we get some short import error right away, print the error log directly
RESULT=$?
if [ "$RESULT" -ne "0" ];
@@ -98,6 +98,17 @@ function run_tests {
then
cat run_tests.log
fi
else
tests_run=$(awk '/^Ran/ {print $2}' nosetests.log)
if [ "$tests_run" -eq 0 ];
then
echo "ERROR: Zero tests ran, something is wrong!"
echo "This is usually caused by a parse error in some python"
echo "file or a failure to set up the environment (i.e. during"
echo "temporary database preparation). Running nosetests directly"
echo "may offer more clues."
return 1
fi
fi
return $RESULT
}