From 045ae7561255022fa8b019b624338ce11ad63e2a Mon Sep 17 00:00:00 2001 From: Keith Holman Date: Fri, 30 May 2014 12:55:48 -0400 Subject: horizon: add full path to test directories The tests included Horizon expect all files to be in a single location in order to be run directly from the source tree. The recipe for installing Horizon on the system installs Horizon as a python site-package and puts files in different locations depending on the file type. In order to have the tests support this type of install we need to explicitly indicate the full path of the test files to exclude in order to have the tests run successfully. This fix adds the absolute path to the test locations allows the Horizon tests to pass as expected. Signed-off-by: Keith Holman --- ...use-full-package-path-to-test-directories.patch | 39 ++++++++++++++++++++++ .../recipes-devtools/python/python-horizon_git.bb | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-horizon/horizon-use-full-package-path-to-test-directories.patch (limited to 'meta-openstack/recipes-devtools/python') 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 @@ +From 89aa2a575687013f4b4f4d4353c50af1de4c26ba Mon Sep 17 00:00:00 2001 +From: Keith Holman +Date: Fri, 30 May 2014 11:58:33 -0400 +Subject: [PATCH] horizon: use full package path to test directories + +The tests included Horizon expect all files to be in a single +location in order to be run directly from the source tree. The +recipe for installing Horizon on the system installs Horizon +as a python site-package and puts files in different locations +depending on the file type. In order to have the tests support +this type of install we need to explicitly indicate the full path +of the test files to exclude in order to have the tests run +successfully. This fix adds an identifier that will be replaced +within the build recipe with the full path to the python site +packages. + +Signed-off-by: Keith Holman +--- + horizon/test/settings.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/horizon/test/settings.py b/horizon/test/settings.py +index f5ea700..10318eb 100644 +--- a/horizon/test/settings.py ++++ b/horizon/test/settings.py +@@ -95,8 +95,8 @@ SITE_BRANDING = 'Horizon' + TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' + NOSE_ARGS = ['--nocapture', + '--nologcapture', +- '--exclude-dir=horizon/conf/', +- '--exclude-dir=horizon/test/customization', ++ '--exclude-dir=%PYTHON_SITEPACKAGES%/horizon/conf/', ++ '--exclude-dir=%PYTHON_SITEPACKAGES%/horizon/test/customization', + '--cover-package=horizon', + '--cover-inclusive', + '--all-modules'] +-- +1.9.3 + diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb index af74472..fd246db 100644 --- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb +++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb @@ -38,6 +38,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ file://openstack-dashboard-apache.conf \ file://local_settings.py \ file://horizon-fix-test-script-to-not-require-coverage-tool.patch \ + file://horizon-use-full-package-path-to-test-directories.patch \ " SRCREV="cd1de75ee2a8c246d5564e96ccc48185816c2290" @@ -68,6 +69,7 @@ do_install_append() { sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' ${WORKDIR}/horizon.init >${WORKDIR}/horizon install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon fi + sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#g' ${D}${PYTHON_SITEPACKAGES_DIR}/horizon/test/settings.py # no longer required. kept as reference. # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin -- cgit v1.2.3-54-g00ecf