gpt4 book ai didi

docker - Jenkins错误安装Xvfb并再次运行Cypress

转载 作者:行者123 更新时间:2023-12-02 18:14:00 48 4
gpt4 key购买 nike

创建一个管道来进行jenkins柏树测试,但是我总是运行它,犯一个错误,并尝试各种解决方案,包括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'
}

关于docker - Jenkins错误安装Xvfb并再次运行Cypress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57174266/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com