[我正在尝试使用Chromium和Karma在Docker(节点:8.15-alpine)上运行前端测试,但是我收到许多与ChromeHeadless相关的错误。
这些测试曾经可以工作,但是最近它们突然停止了,所以我想它与第三方依赖项(apk?)或本地Docker安装有关。
我已经通过易于运行的命令在仓库上创建了一个分支,该命令再现了问题。 README.md在这里:https://github.com/olivercaine/react-redux-starter-kit-extended/tree/bug/cant-run-unit-tests-in-docker
对此的任何帮助将不胜感激!
谢谢。
预期结果:
[output of passed tests...]
Finished in 0.026 secs / 0.031 secs @ 19:53:44 GMT+1100 (AEDT)
SUMMARY:
✔ 46 tests completed
实际结果:
13 02 2020 09:10:45.314:ERROR [launcher]: Cannot start ChromeHeadless
13 02 2020 09:10:45.316:ERROR [launcher]: ChromeHeadless stdout:
13 02 2020 09:10:45.317:ERROR [launcher]: ChromeHeadless stderr:
13 02 2020 09:10:45.772:ERROR [launcher]: Cannot start ChromeHeadless
13 02 2020 09:10:45.772:ERROR [launcher]: ChromeHeadless stdout:
13 02 2020 09:10:45.773:ERROR [launcher]: ChromeHeadless stderr:
13 02 2020 09:10:45.939:ERROR [launcher]: Cannot start ChromeHeadless
13 02 2020 09:10:45.939:ERROR [launcher]: ChromeHeadless stdout:
13 02 2020 09:10:45.939:ERROR [launcher]: ChromeHeadless stderr:
13 02 2020 09:10:46.424:ERROR [launcher]: ChromeHeadless failed 2 times (cannot start). Giving up.
Finished in 0 secs / 0 secs @ 09:10:46 GMT+0000 (UTC)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `cross-env NODE_ENV=test karma start build/karma.config`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-02-13T09_10_46_935Z-debug.log
似乎关于您使用的node:8-alpine