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
This commit is contained in:
manchandavishal 2022-12-06 16:40:28 +05:30 committed by Vishal Manchanda
parent 774972c447
commit 529cfb2c9f
1 changed files with 10 additions and 1 deletions

View File

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