angular - docker 容器中的 GitLab 管道 e2e 测试失败
问题描述
[11:05:45] I/launcher - Running 1 instances of WebDriver
[11:05:45] I/direct - Using ChromeDriver directly...
[11:05:45] E/launcher - unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 4.19.78-coreos x86_64)
[11:05:45] E/launcher - WebDriverError: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Linux 4.19.78-coreos x86_64)
at Object.checkLegacyResponse (/builds/raphael.brunn3r/tqranalytics/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/builds/raphael.brunn3r/tqranalytics/node_modules/selenium-webdriver/lib/http.js:509:13)
at /builds/raphael.brunn3r/tqranalytics/node_modules/selenium-webdriver/lib/http.js:441:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
From: Task: WebDriver.createSession()
at Function.createSession (/builds/raphael.brunn3r/tqranalytics/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/builds/raphael.brunn3r/tqranalytics/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver (/builds/raphael.brunn3r/tqranalytics/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser (/builds/raphael.brunn3r/tqranalytics/node_modules/protractor/built/runner.js:195:43)
at /builds/raphael.brunn3r/tqranalytics/node_modules/protractor/built/runner.js:339:29
at _fulfilled (/builds/raphael.brunn3r/tqranalytics/node_modules/q/q.js:834:54)
at /builds/raphael.brunn3r/tqranalytics/node_modules/q/q.js:863:30
at Promise.promise.promiseDispatch (/builds/raphael.brunn3r/tqranalytics/node_modules/q/q.js:796:13)
at /builds/raphael.brunn3r/tqranalytics/node_modules/q/q.js:556:49
at runSingle (/builds/raphael.brunn3r/tqranalytics/node_modules/q/q.js:137:13)
[11:05:45] E/launcher - Process exited with error code 199
ERROR: Job failed: exit code 1
我收到此错误,但我不知道如何修复它。它在本地工作,但是当我将它推送到 gitlab 并尝试在 docker 容器中运行测试时(图像 trion/ng-cli-karma:8.3.25)它失败了。下面你可以找到我的 yml 文件。
image: trion/ng-cli-karma:${CLI_VERSION}
stages:
- test
- deploy
variables:
CLI_VERSION: 8.3.25
run_tests:
stage: test
allow_failure: false
before_script:
- npm ci
- google-chrome --version
script:
- ng test --progress false --watch false
- ng e2e -c=mock
only:
- development
- master
artifacts:
expire_in: 1 day
paths:
- .dist/
tags:
- docker
解决方案
推荐阅读
- sql - SQL使用方法'caching_sha2_password'错误
- json - 我需要在飞镖颤振中将嵌套的 json 合并到简单的 json
- python - 是否有任何指定的方法可以从 python 文件生成可执行文件?
- reactjs - 材质 UI 表错误“TypeError:rows.slice 不是函数”
- json - 如果侄子元素数组包含值,则显示对象
- mongodb - 从数组减去时间到数组MongoDB
- javascript - 更改值并重新运行代码时,模板文字字符串不会更新
- if-statement - 从众多可能性中选择一个选项
- url-modification - 通过附加字符批量转换网络链接
- postgresql - 带有行子集的 pg_notify