Closed sshelake25 closed 2 weeks ago
Any help? I am really stuck to run e2e test on azure ci pipeline
Hi, it seems like the command is timing out. Could you try to increase the timeout in your cypress.config.ts
?
...nxE2EPreset(__dirname, {
webServerCommands: {
default: 'pnpm exec nx run graph-client:serve --configuration=dev-e2e',
},
webServerConfig: {
timeout: 120000,
},
}),
How long does it take for you locally? Sometimes CI takes longer to run commands.
@leosvelperez Is the timeout documented? I couldn't find it here: https://nx.dev/nx-api/cypress#splitting-e2e-tasks-by-file
This issue has been automatically marked as stale because more information has not been provided within 7 days. It will be closed in 21 days if no information is provided. If information has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Current Behavior
Can we update steps in current CI setup how to run cypress for angular e2e project in azure devosp https://nx.dev/ci/recipes/set-up/monorepo-ci-azure
NX Running target e2e-ci for project hello-e2e and 1 task it depends on failed
nx run hello-e2e:e2e-ci--src/e2e/app.cy.ts 2024-07-24T17:02:05.8346163Z 2024-07-24T17:02:06.4037838Z It looks like this is your first time using Cypress: [36m13.10.0[39m 2024-07-24T17:02:06.4038466Z 2024-07-24T17:02:06.4076369Z [STARTED] Task without title. 2024-07-24T17:02:08.1896230Z [SUCCESS] Task without title. 2024-07-24T17:02:08.1896776Z 2024-07-24T17:02:08.1897143Z Opening Cypress... 2024-07-24T17:02:08.4247829Z 2024-07-24T17:02:09.7781853Z 2024-07-24T17:02:09.7789432Z DevTools listening on ws://127.0.0.1:50851/devtools/browser/f81fc2fa-7bae-4e08-adf1-15c29544ed4a 2024-07-24T17:02:12.7155936Z spawn EINVAL 2024-07-24T17:03:12.4662843Z [31mYour [95mconfigFile[31m threw an error from: [94mD:\a\1\s\apps\hello-e2e\cypress.config.ts[31m[39m 2024-07-24T17:03:12.4667681Z [31m[39m 2024-07-24T17:03:12.4670778Z [31mThe error was thrown while executing your [33me2e.setupNodeEvents()[31m function:[39m 2024-07-24T17:03:12.4680846Z [35m[39m 2024-07-24T17:03:12.4688911Z [35mError: Web server failed to start in 60000ms. This can be configured in cypress.config.ts.[39m 2024-07-24T17:03:12.4698390Z [35m at Timeout._onTimeout (D:\a\1\s\node_modules\@nx\cypress\plugins\cypress-preset.js:124:20)[39m 2024-07-24T17:03:12.4702489Z [35m at listOnTimeout (node:internal/timers:569:17)[39m 2024-07-24T17:03:12.4703418Z [35m at processTimers (node:internal/timers:512:7)[39m 2024-07-24T17:03:12.5485111Z Warning: command "cypress run --env webServerCommand="npx nx run hello:serve-static --verbose" --spec src/e2e/app.cy.ts" exited with non-zero status code 2024-07-24T17:03:12.5487840Z 2024-07-24T17:03:12.5489992Z 2024-07-24T17:03:12.5490764Z NX Running target e2e-ci for project hello-e2e and 1 task it depends on failed 2024-07-24T17:03:12.5491094Z 2024-07-24T17:03:12.5491366Z Failed tasks: 2024-07-24T17:03:12.5491538Z 2024-07-24T17:03:12.5491812Z - hello-e2e:e2e-ci--src/e2e/app.cy.ts 2024-07-24T17:03:12.5491986Z
Expected Behavior
should able to run cypress test as part of azure devops CI pipeline
GitHub Repo
No response
Steps to Reproduce
1. create angular nx project with end to end project setp simple devops pipeline to cypress end to end test in cli in local enviroment e2e ci commnad working find
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
locally running fine Building... polyfills-3ITNT4UF.js 34.3kb Done in 177ms main-VBHUS333.js 202.4kb Done in 16542ms Initial chunk files | Names | Raw size | Estimated transfer size main-VBHUS333.js | main | 202.44 kB | 53.81 kB polyfills-3ITNT4UF.js | polyfills | 34.28 kB | 11.14 kB styles-5INURTSO.css | styles | 0 bytes | 0 bytes
Output location: D:\who\Omni\dist\apps\hello
Application bundle generation complete. [18.839 seconds]
NX Successfully ran target build for project hello
Starting up http-server, serving dist/apps/hello/browser
http-server version: 14.1.1
http-server settings: CORS: true Cache: -1 seconds Connection Timeout: 120 seconds Directory Listings: visible AutoIndex: visible Serve GZIP Files: false Serve Brotli Files: false Default File Extension: none
Available on: http://localhost:4200 Unhandled requests will be served from: http://localhost:4200?. Options: {"secure":false,"prependPath":true} Hit CTRL-C to stop the server
(node:23636) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated (Use
node --trace-deprecation ...
to show where the warning was created)====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.10.0 │ │ Browser: Electron 118 (headless) │ │ Node Version: v20.9.0 (C:\Program Files\nodejs\node.exe) │ │ Specs: 1 found (app.cy.ts) │ │ Searched: D:\who\Omni\apps\hello-e2e\src\e2e\app.cy.ts │ └────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app.cy.ts (1 of 1)
hello-e2e √ should display welcome message (682ms)
1 passing (762ms)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: false │ │ Duration: 0 seconds │ │ Spec Ran: app.cy.ts │ └────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ app.cy.ts 760ms 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 760ms 1 1 - - -
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Successfully ran target e2e-ci for project hello-e2e and 1 task it depends on (1m)