From 529cfb2c9feed4dd882d10a656dbdb0430a4b701 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Tue, 6 Dec 2022 16:40:28 +0530 Subject: [PATCH] Remove hard-coded Python path in karma.conf.js This patch removes hard-coded Python path in karma.conf.js to fix the npm jobs because now these npm jobs run on debian-bullseye and py38 are not available there. Change-Id: I7a94478340937e0e3ca2fc333470efadbdf22a80 --- octavia_dashboard/karma.conf.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/octavia_dashboard/karma.conf.js b/octavia_dashboard/karma.conf.js index 19651859..14c91c6f 100644 --- a/octavia_dashboard/karma.conf.js +++ b/octavia_dashboard/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/karma/lib/python3.8//site-packages/'; + var toxPath = path.resolve('./.tox/karma'); + if (!toxPath) { + console.error('xStatic libraries not found, please run `tox -e karma`'); + process.exit(1); + } + toxPath += '/lib/'; + toxPath += fs.readdirSync(toxPath).find(function(directory) { + return directory.indexOf('python') === 0; + }); + toxPath += '/site-packages/'; config.set({ preprocessors: {