diff --git a/karma.conf.js b/karma.conf.js index 083203b08..7e018cb16 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -21,7 +21,16 @@ var path = require('path'); module.exports = function (config) { // This tox venv is setup in the post-install npm step - var toxPath = '.tox/py38/lib/python3.8/site-packages/'; + var toxPath = path.resolve('./.tox/npm'); + if (!toxPath) { + console.error('xStatic libraries not found, please run `tox -e npm`'); + process.exit(1); + } + toxPath += '/lib/'; + toxPath += fs.readdirSync(toxPath).find(function(directory) { + return directory.indexOf('python') === 0; + }); + toxPath += '/site-packages/'; var xstaticPath = toxPath + 'xstatic/pkg/'; config.set({ diff --git a/tools/post_install.sh b/tools/post_install.sh index d7478f3b4..4a321b9f0 100755 --- a/tools/post_install.sh +++ b/tools/post_install.sh @@ -10,4 +10,4 @@ then fi echo "Creating a tox env which will contain xStatic libraries, horizon, and openstack_dashboard" -tox -epy38 --notest +tox -enpm --notest diff --git a/tox.ini b/tox.ini index 7ac4e7fe3..b2ad11e55 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] -envlist = py38,pep8 +envlist = py38, pep8, npm minversion = 2.0 -skipsdist = True ignore_basepython_conflict = True [testenv] @@ -9,11 +8,12 @@ basepython = python3 usedevelop = True setenv = VIRTUAL_ENV={envdir} DJANGO_SETTINGS_MODULE=muranodashboard.tests.settings -passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY +passenv = http_proxy, HTTP_PROXY, https_proxy, HTTPS_PROXY, no_proxy, NO_PROXY deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt http://tarballs.openstack.org/heat-dashboard/heat-dashboard-master.tar.gz +allowlist_externals = {toxinidir}/manage.py commands = {toxinidir}/manage.py test muranodashboard --settings=muranodashboard.tests.settings