diff --git a/ironic_ui/karma.conf.js b/ironic_ui/karma.conf.js index 2385e65a..a5ad9883 100644 --- a/ironic_ui/karma.conf.js +++ b/ironic_ui/karma.conf.js @@ -12,12 +12,24 @@ * limitations under the License. */ +var fs = require('fs'); +var path = require('path'); + (function () { 'use strict'; 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/'; config.set({ preprocessors: { diff --git a/package.json b/package.json index a71f99e6..f93a6db5 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "karma-threshold-reporter": "^0.1.15" }, "scripts": { - "postinstall": "if [ ! -d .tox ] || [ ! -d .tox/py38 ]; then tox -epy38 --notest; fi", + "postinstall": "if [ ! -d .tox/npm ]; then tox -e npm --notest; fi", "test": "karma start ironic_ui/karma.conf.js --single-run", "lint": "eslint --no-color ironic_ui/static", "lintq": "eslint --quiet ironic_ui/static"