需要安装Xvfb才能运行位桶管道



查看以前的票证,它似乎必须从NPM库安装,我不确定为什么要求我安装它,因为我无法在管道下运行Sudo。

这是我的输出:

> installation_cypress@1.0.0 cy:run /opt/atlassian/pipelines/agent/build
> cypress run
It looks like this is your first time using Cypress: 6.2.1
[21:42:54]  Verifying Cypress can run /root/.cache/Cypress/6.2.1/Cypress [started]
[21:42:54]  Verifying Cypress can run /root/.cache/Cypress/6.2.1/Cypress [failed]
Your 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 (Debian - 9.9)
Cypress Version: 6.2.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! installation_cypress@1.0.0 cy:run: `cypress run`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the installation_cypress@1.0.0 cy:run 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/2021-01-07T21_42_54_586Z-debug.log
2021-01-07T21:42:54.598292177Z stdout P 

我们应该做些什么来解决这个问题?

最好的解决方案是在您的YAML文件上使用不同的配置。

现在,我通过使用以下配置解决了这个问题:

package.json:


"scripts": {

"jira:chrome": "cypress run --group 1x-chrome --record --headless --browser chrome",

"jira:firefox": "cypress run --group 1x-firefox --record --headless --browser firefox",

"jira:electron": "cypress run --group 1x-electron --record  --headless --browser electron"
}

比特币。yaml:



image: cypress/included:6.2.1
options:
max-time: 10

# job definition cross-browser testing
jira-chrome: &jira-chrome
name: JIRA Chrome tests
caches:
- node
- cypress
script:
- npx @bahmutov/print-env BITBUCKET
- npm run jira:chrome -- --ci-build-id $BITBUCKET_BUILD_NUMBER --key [Project_Key_From_Cypress_Dashboard]
artifacts:
# store any generates images and videos as artifacts
- cypress/screenshots/**
- cypress/videos/**


jira-firefox: &jira-firefox
name: JIRA Firefox tests
caches:
- node
- cypress
script:
- npx @bahmutov/print-env BITBUCKET
- npm run jira:firefox -- --ci-build-id $BITBUCKET_BUILD_NUMBER --key [Project_Key_From_Cypress_Dashboard]

artifacts:
# store any generates images and videos as artifacts
- cypress/screenshots/**
- cypress/videos/**


jira-electron: &jira-electron
name: JIRA Electron tests
caches:
- node
- cypress
script:
- npx @bahmutov/print-env BITBUCKET
- npm run jira:electron -- --ci-build-id $BITBUCKET_BUILD_NUMBER --key [Project_Key_From_Cypress_Dashboard]

artifacts:
# store any generates images and videos as artifacts
- cypress/screenshots/**
- cypress/videos/**

pipelines:
default:
- step:
name: Install dependencies
caches:
- npm
- cypress
- node
script:
- npm ci
- npx @bahmutov/print-env BITBUCKET
- parallel:
# cross-browser testing
- step:
<<: *jira-chrome    
- step:
<<: *jira-firefox
- step:
<<: *jira-electron
definitions:
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress

这将解决此问题。如果您有任何问题或顾虑,请告诉我,我将非常乐意帮助您。。。!

最新更新