diff options
3 files changed, 41 insertions, 66 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 deleted file mode 100644 index 83ac9a4..0000000 --- a/meta-openstack/recipes-devtools/python/python-horizon/horizon-fix-test-script-to-not-require-coverage-tool.patch +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | From 7f9d9b9d5f5621f00ba1a425307de0c242fc3453 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Keith Holman <Keith.Holman@windriver.com> | ||
| 3 | Date: Fri, 30 May 2014 11:40:39 -0400 | ||
| 4 | Subject: [PATCH] horizon: fix test script to not require coverage tool | ||
| 5 | |||
| 6 | Horizon provides a run_tests.sh script for testing the | ||
| 7 | functionality of the installation of the product in the target | ||
| 8 | environment. The script contains a "-c" option to allow code | ||
| 9 | coverage testing using the "coverage" tool. However, the | ||
| 10 | script currently still calls the tool even if the option is not | ||
| 11 | given. This fix removes the dependency on the "coverage" | ||
| 12 | command if the "-c" option is not passed to the script. | ||
| 13 | |||
| 14 | Signed-off-by: Keith Holman <Keith.Holman@windriver.com> | ||
| 15 | --- | ||
| 16 | run_tests.sh | 18 +++++++++++++----- | ||
| 17 | 1 file changed, 13 insertions(+), 5 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/run_tests.sh b/run_tests.sh | ||
| 20 | index 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 | -- | ||
| 64 | 1.9.3 | ||
| 65 | |||
diff --git a/meta-openstack/recipes-devtools/python/python-horizon/horizon-use-full-package-path-to-test-directories.patch b/meta-openstack/recipes-devtools/python/python-horizon/horizon-use-full-package-path-to-test-directories.patch new file mode 100644 index 0000000..e5e1966 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-horizon/horizon-use-full-package-path-to-test-directories.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 89aa2a575687013f4b4f4d4353c50af1de4c26ba Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Keith Holman <Keith.Holman@windriver.com> | ||
| 3 | Date: Fri, 30 May 2014 11:58:33 -0400 | ||
| 4 | Subject: [PATCH] horizon: use full package path to test directories | ||
| 5 | |||
| 6 | The tests included Horizon expect all files to be in a single | ||
| 7 | location in order to be run directly from the source tree. The | ||
| 8 | recipe for installing Horizon on the system installs Horizon | ||
| 9 | as a python site-package and puts files in different locations | ||
| 10 | depending on the file type. In order to have the tests support | ||
| 11 | this type of install we need to explicitly indicate the full path | ||
| 12 | of the test files to exclude in order to have the tests run | ||
| 13 | successfully. This fix adds an identifier that will be replaced | ||
| 14 | within the build recipe with the full path to the python site | ||
| 15 | packages. | ||
| 16 | |||
| 17 | Signed-off-by: Keith Holman <Keith.Holman@windriver.com> | ||
| 18 | --- | ||
| 19 | horizon/test/settings.py | 4 ++-- | ||
| 20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/horizon/test/settings.py b/horizon/test/settings.py | ||
| 23 | index f5ea700..10318eb 100644 | ||
| 24 | --- a/horizon/test/settings.py | ||
| 25 | +++ b/horizon/test/settings.py | ||
| 26 | @@ -95,8 +95,8 @@ SITE_BRANDING = 'Horizon' | ||
| 27 | TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' | ||
| 28 | NOSE_ARGS = ['--nocapture', | ||
| 29 | '--nologcapture', | ||
| 30 | - '--exclude-dir=horizon/conf/', | ||
| 31 | - '--exclude-dir=horizon/test/customization', | ||
| 32 | + '--exclude-dir=%PYTHON_SITEPACKAGES%/horizon/conf/', | ||
| 33 | + '--exclude-dir=%PYTHON_SITEPACKAGES%/horizon/test/customization', | ||
| 34 | '--cover-package=horizon', | ||
| 35 | '--cover-inclusive', | ||
| 36 | '--all-modules'] | ||
| 37 | -- | ||
| 38 | 1.9.3 | ||
| 39 | |||
diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb index 3924fc8..3f9e5e6 100644 --- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb +++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb | |||
| @@ -38,7 +38,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/icehouse \ | |||
| 38 | file://fix_bindir_path.patch \ | 38 | file://fix_bindir_path.patch \ |
| 39 | file://openstack-dashboard-apache.conf \ | 39 | file://openstack-dashboard-apache.conf \ |
| 40 | file://local_settings.py \ | 40 | file://local_settings.py \ |
| 41 | file://horizon-fix-test-script-to-not-require-coverage-tool.patch \ | 41 | file://horizon-use-full-package-path-to-test-directories.patch \ |
| 42 | " | 42 | " |
| 43 | 43 | ||
| 44 | SRCREV="0c3b71055c0d169b8245aee773438dbcb46c2bcf" | 44 | SRCREV="0c3b71055c0d169b8245aee773438dbcb46c2bcf" |
| @@ -69,6 +69,7 @@ do_install_append() { | |||
| 69 | sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' ${WORKDIR}/horizon.init >${WORKDIR}/horizon | 69 | sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' ${WORKDIR}/horizon.init >${WORKDIR}/horizon |
| 70 | install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon | 70 | install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon |
| 71 | fi | 71 | fi |
| 72 | sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#g' ${D}${PYTHON_SITEPACKAGES_DIR}/horizon/test/settings.py | ||
| 72 | 73 | ||
| 73 | # no longer required. kept as reference. | 74 | # no longer required. kept as reference. |
| 74 | # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin | 75 | # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin |
