summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Vidori <maxime.vidori@enovance.com>2014-04-09 18:38:05 +0200
committerMaxime Vidori <maxime.vidori@enovance.com>2014-04-09 18:38:05 +0200
commitd2d2e5b6a197d2b5612c2942cd2eb965a3da3235 (patch)
tree4b95774a5ec90f7bc87581ed0d5e4c38bd10e2f1
parent198dba6a2d92b8157b86285f5b0cb000e64ae7ac (diff)
downloadhorizon-d2d2e5b6a197d2b5612c2942cd2eb965a3da3235.tar.gz
Use "python -m coverage" rather than use "coverage" explicitly
When coverage module is installed using a package from Debian/Ubuntu, the command name is "python-coverage". By using "python -m coverage" the coverage module is detected in both cases. Change-Id: Icf9084855b83d0cc721de5325f38cf72ac85ff81 Closes-Bug: #1241332 Co-Authored-By: florent <florent.flament-ext@cloudwatt.com>
-rwxr-xr-xrun_tests.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/run_tests.sh b/run_tests.sh
index ffab99e9b..00c1edfa5 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -319,8 +319,8 @@ function run_tests_all {
export NOSE_HTML_OUT_FILE='horizon_nose_results.html'
fi
if [ $with_coverage -eq 1 ]; then
- ${command_wrapper} coverage erase
- coverage_run="coverage run -p"
+ ${command_wrapper} python -m coverage.__main__ erase
+ coverage_run="python -m coverage.__main__ run -p"
fi
${command_wrapper} ${coverage_run} $root/manage.py test horizon --settings=horizon.test.settings $testopts
# get results of the Horizon tests
@@ -337,9 +337,9 @@ function run_tests_all {
if [ $with_coverage -eq 1 ]; then
echo "Generating coverage reports"
- ${command_wrapper} coverage combine
- ${command_wrapper} coverage xml -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*'
- ${command_wrapper} coverage html -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
+ ${command_wrapper} python -m coverage.__main__ combine
+ ${command_wrapper} python -m coverage.__main__ xml -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*'
+ ${command_wrapper} python -m coverage.__main__ html -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
fi
# Remove the leftover coverage files from the -p flag earlier.
rm -f .coverage.*