docker - Jenkins 错误安装 Xvfb 并再次运行 Cypress
问题描述
创建一个管道来做 jenkins cypress 测试,但我总是运行它,出错,并尝试各种解决方案,包括 Jenkins Xvfb
,但我仍然没有成功。
错误
+ npm run exec:e2e
> projectname@0.1.0 exec:e2e /var/lib/jenkins/workspace/project/myproject
> npx cypress run
It looks like this is your first time using Cypress: 3.4.0
[?25l[01:56:21] Verifying Cypress can run /var/lib/jenkins/.cache/Cypress/3.4.0/Cypress [started]
[01:56:21] Verifying Cypress can run /var/lib/jenkins/.cache/Cypress/3.4.0/Cypress [failed]
[?25hYour system is missing the dependency: Xvfb
Install Xvfb and run Cypress again.
Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Error: spawn Xvfb ENOENT
----------
Platform: linux (Ubuntu Linux - 19.04)
Cypress Version: 3.4.0
[?25hnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projectname@0.1.0 exec:e2e: `npx cypress run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projectname@0.1.0 exec:e2e 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! /var/lib/jenkins/.npm/_logs/2019-07-24T01_56_21_795Z-debug.log
解决方案
我用其他解决方案解决了这个问题。
首先,我创建了一个pipeline
stage('E2E Tests') {
sh 'docker run -v $PWD:/e2e -w /e2e cypress/included:3.4.0'
}
推荐阅读
- reactjs - React Typescript:如何在 react-router-dom 中输入位置
- java - 有没有与java中的c#等价的东西?
- excel - 如何使用VBA复制excel中的一列单元格,直到出现空白并将其粘贴到新工作表中?
- python - 安装 pyarrow 和 fastparquet 失败
- java - 如何在java中添加一个可以比较两个树结构的函数?
- javascript - fs.readFileSync() 更改最大缓冲区大小
- python - 为什么示踪剂在 Python 中制造另一只乌龟
- php - Symfony 3.4:错误预期类型...找到
- c# - windows服务不会执行
- javascript - “错误”:“消息”:“无法读取未定义的属性‘名称’”