Merge "Remove hard-coded Python path in karma.conf.js"

This commit is contained in:
Zuul 2020-10-30 09:54:51 +00:00 committed by Gerrit Code Review
commit a11375c2c8
2 changed files with 14 additions and 2 deletions

View File

@ -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: {

View File

@ -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"