【问题标题】:gitlab error in testing a lit-element app测试发光元素应用程序时出现 gitlab 错误
【发布时间】:2020-02-11 10:35:10
【问题描述】:

我正在使用 Gitlab 作为我的项目的 CI/CD 工具,我在尝试运行测试时遇到此错误:

> pwa-starter-kit@0.9.0 test:unit /builds/jperera84/prop-mgm-app
> polymer test --module-resolution=node --npm


Error: No browsers configured to run

error:  cli runtime exception: Error: No browsers configured to run error:  Error: No browsers configured to run
    at Object.<anonymous> (/builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/config.js:518:19)
    at Generator.next (<anonymous>)
    at /builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/config.js:20:71
    at new Promise (<anonymous>)
    at __awaiter (/builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/config.js:16:12)
    at Object.validate (/builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/config.js:506:12)
    at Object.<anonymous> (/builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:64:22)
    at Generator.next (<anonymous>)
    at fulfilled (/builds/jperera84/prop-mgm-app/node_modules/polymer-cli/node_modules/web-component-tester/runner/steps.js:4:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pwa-starter-kit@0.9.0 test:unit: `polymer test
--module-resolution=node --npm` npm ERR! Exit status 1 npm ERR!  npm ERR! Failed at the pwa-starter-kit@0.9.0 test:unit 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/2019-10-12T00_10_45_442Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pwa-starter-kit@0.9.0 test: `npm run test:unit && npm run test:integration` npm ERR! Exit status 1 npm ERR!  npm ERR! Failed at the pwa-starter-kit@0.9.0 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/2019-10-12T00_10_45_483Z-debug.log ERROR: Job failed: exit code 1

我查看了一些关于此的文档,但我还没有找到配置我的 .gitlab-ci.yml 以使其正常工作的方法:

这是我的 .gitlab-ci.yml 文件:

image: node:latest

variables:
  LAUNCHPAD_FIREFOX: /usr/local/bin/firefox
  LAUNCHPAD_CHROME: /usr/bin/chromium-browser

stages:
  - build
  - test

cache:
  paths:
    - node_modules/

install_dependencies:
  stage: build
  script:
    - npm install
  artifacts:
    paths:
      - node_modules/

testing_integration:
  stage: test
  script:
    - npm run test

这是一个基本上运行 Starter-kit 的 Lit-Element 项目。

谁能帮我找到一个可能的解决方案?

谢谢

【问题讨论】:

  • 这里的错误很简单:“错误:没有配置运行的浏览器”——可能浏览器应该安装在容器中以在无头模式下工作?
  • 谢谢@Janusz 我完全同意你的看法,我知道问题是没有安装浏览器,我的问题是,如果有人以前这样做过并帮助我找到正确的配置来安装浏览器。

标签: gitlab polymer-starter-kit lit-element


【解决方案1】:

看起来您需要构建自己的图像。从 node:latest(基于 Debian)开始,然后添加 Chromium/Firefox。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-25
    • 1970-01-01
    相关资源
    最近更新 更多