Skip to content

Commit

Permalink
Speed up unit tests without coverage
Browse files Browse the repository at this point in the history
Previously coverage command is always used even if coverage is
not enabled and this makes unit tests slower.

Change-Id: I4311164ef907fbdc66ac66d4999b25054bc9eebd
Closes-Bug: #1272979
  • Loading branch information
amotoki committed Jan 26, 2014
1 parent cb6f062 commit c41db65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions run_tests.sh
Expand Up @@ -310,8 +310,11 @@ function run_tests_all {
if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
export NOSE_HTML_OUT_FILE='horizon_nose_results.html'
fi
${command_wrapper} coverage erase
${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.test.settings $testopts
if [ $with_coverage -eq 1 ]; then
${command_wrapper} coverage erase
coverage_run="coverage run -p"
fi
${command_wrapper} ${coverage_run} $root/manage.py test horizon --settings=horizon.test.settings $testopts
# get results of the Horizon tests
HORIZON_RESULT=$?

Expand All @@ -320,7 +323,7 @@ function run_tests_all {
if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
export NOSE_HTML_OUT_FILE='dashboard_nose_results.html'
fi
${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
${command_wrapper} ${coverage_run} $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
# get results of the openstack_dashboard tests
DASHBOARD_RESULT=$?

Expand Down

0 comments on commit c41db65

Please sign in to comment.