我试图让我的Karma Unit测试在远程Jenkins服务器上运行。这个Jenkins服务器在Linux上运行,已经安装了旧版本的PhantomJS,并在环境中定义了PHANTOMJS_BIN。我使用gulp-karma和karma-phantomjs-launcher-nonet包来运行业力测试。
然而,当jenkins解雇Karma时,它似乎无法产生PhantomJS。我收到以下错误:
[13:33:00]启动Karma服务器... [32mINFO [业力]:[39mKarma v0.12.37服务器开始于http://localhost:9876/ [32mINFO [启动器]:[39m启动浏览器PhantomJS [31mERROR [karma] :[39m {[错误:产生EACCES]代码:' EACCES',错误:' EACCES',系统调用:'产生'错误:在exports._execCommand的exports.spawn(child_process.js:339:9)的ChildProcess.spawn(internal / child_process.js:298:11)的exports._errnoException(util.js:874:11)处生成EACCES (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:63:21)在Object._start(/ appl / jenkins / workspace / ps-lib / node_modules / karma-phantomjs-) launcher-nonet / index.js:40:10)在Object。 (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/process.js:14:10)在emit.ene(events.js:82:20)的Object.emit(events.js:169: 7)在/ appl / jenkins / workspace / ps-lib / node_modules / karma /的Object.start(/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launchers/base.js:40:10) lib / launcher.js:88:15在[object object] .launch(/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/launcher.js:40:11)的Array.forEach(native)处服务器上的[object Object] .invoke(/appl/jenkins/workspace/ps-lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)。 (/appl/jenkins/workspace/ps-lib/node_modules/karma/lib/server.js:62:18)在Servers.g(events.js:260:16)的emitNone(events.js:72:20)在atETCallback1(node.js:430:9)的emit.eiste(events.js:166:7)处的server.emit(events.js:166:7)at process._tickCallback(node.js:352:17)
/appl/jenkins/workspace/ps-lib/tasks/test.js:15 throw err; ^ 错误:karma退出代码1 完成后(/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:56:30) 在ChildProcess。 (/appl/jenkins/workspace/ps-lib/node_modules/gulp-karma/index.js:82:7) 在emitTwo(events.js:87:13) 在ChildProcess.emit(events.js:172:7) 在Process.ChildProcess._handle.onexit(internal / child_process.js:200:12)
所以在我看来,由于授权原因我的业力无法运行PhantomJS,我是对的吗?仍然是用户jenkins // jenkins安装了phantomjs,所以jenkins应该可以运行它,对吗?