summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-horizon
diff options
context:
space:
mode:
authorKeith Holman <Keith.Holman@windriver.com>2014-05-30 11:43:47 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-06-04 09:24:46 -0400
commit5e78faf2cff56de25f6c63fd3c33bd835e4b7d48 (patch)
tree7e8e189749f897738b32d994045fcc1bfaf7f889 /meta-openstack/recipes-devtools/python/python-horizon
parent320dc352ec7b088d688ed6db3ad44fdff0ac5ac2 (diff)
downloadmeta-cloud-services-5e78faf2cff56de25f6c63fd3c33bd835e4b7d48.tar.gz
horizon: patch test script to run without coverage
Currently, the run_tests.sh script provided by the horizon package requires the command "coverage" to be available even if the "-c" option (test with code coverage) is not specified on the command line. This fix patches the test script to remove the calls to the "coverage" tool and calls the test script directly if the "-c" option is not provided. Signed-off-by: Keith Holman <Keith.Holman@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-horizon')
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon/horizon-fix-test-script-to-not-require-coverage-tool.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-horizon/horizon-fix-test-script-to-not-require-coverage-tool.patch b/meta-openstack/recipes-devtools/python/python-horizon/horizon-fix-test-script-to-not-require-coverage-tool.patch
new file mode 100644
index 0000000..83ac9a4
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-horizon/horizon-fix-test-script-to-not-require-coverage-tool.patch
@@ -0,0 +1,65 @@
1From 7f9d9b9d5f5621f00ba1a425307de0c242fc3453 Mon Sep 17 00:00:00 2001
2From: Keith Holman <Keith.Holman@windriver.com>
3Date: Fri, 30 May 2014 11:40:39 -0400
4Subject: [PATCH] horizon: fix test script to not require coverage tool
5
6Horizon provides a run_tests.sh script for testing the
7functionality of the installation of the product in the target
8environment. The script contains a "-c" option to allow code
9coverage testing using the "coverage" tool. However, the
10script currently still calls the tool even if the option is not
11given. This fix removes the dependency on the "coverage"
12command if the "-c" option is not passed to the script.
13
14Signed-off-by: Keith Holman <Keith.Holman@windriver.com>
15---
16 run_tests.sh | 18 +++++++++++++-----
17 1 file changed, 13 insertions(+), 5 deletions(-)
18
19diff --git a/run_tests.sh b/run_tests.sh
20index 5993c81..a297cd9 100755
21--- a/run_tests.sh
22+++ b/run_tests.sh
23@@ -298,8 +298,12 @@ function run_tests_all {
24 if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
25 export NOSE_HTML_OUT_FILE='horizon_nose_results.html'
26 fi
27- ${command_wrapper} coverage erase
28- ${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.test.settings $testopts
29+ if [ $with_coverage -eq 1 ]; then
30+ ${command_wrapper} coverage erase
31+ ${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.test.settings $testopts
32+ else
33+ ${command_wrapper} python $root/manage.py test horizon --settings=horizon.test.settings $testopts
34+ fi
35 # get results of the Horizon tests
36 HORIZON_RESULT=$?
37
38@@ -308,7 +312,11 @@ function run_tests_all {
39 if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
40 export NOSE_HTML_OUT_FILE='dashboard_nose_results.html'
41 fi
42- ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
43+ if [ $with_coverage -eq 1 ]; then
44+ ${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
45+ else
46+ ${command_wrapper} python $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
47+ fi
48 # get results of the openstack_dashboard tests
49 DASHBOARD_RESULT=$?
50
51@@ -317,9 +325,9 @@ function run_tests_all {
52 ${command_wrapper} coverage combine
53 ${command_wrapper} coverage xml -i --omit='/usr*,setup.py,*egg*,.venv/*'
54 ${command_wrapper} coverage html -i --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
55+ # Remove the leftover coverage files from the -p flag earlier.
56+ rm -f .coverage.*
57 fi
58- # Remove the leftover coverage files from the -p flag earlier.
59- rm -f .coverage.*
60
61 if [ $(($HORIZON_RESULT || $DASHBOARD_RESULT)) -eq 0 ]; then
62 echo "Tests completed successfully."
63--
641.9.3
65