question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress end-to-end test fails when ciBuildId is parseable as number

See original GitHub issue

When I try to run cypress through nx the command line string value for ciBuildId is parsed as a number if the string can be interpreted as a valid base 10 number. Then it complains that it should be a string and aborts.

Parsing shouldn’t happen if unnecessary, let alone if the result would be program failure.

For now I’ll try to workaround this by calling cypress directly outside nx

Current Behavior

Property ‘ciBuildId’ does not match the schema. ‘12345’ should be a ‘string’.

Expected Behavior

nx e2e runs successfully. 12345 is passed as a string on the command line, so there’s no reason to parse it to a number and then complain that it isn’t a string.

Steps to Reproduce

Use nx e2e to run a cypress end-to-end test and pass in the --ciBuildId manually (required for Azure DevOps).

Note: I’ve tried to pass the ci-build-id flag directly to cypress, however when I do that, the nx command will add a duplicated value as --ciBuildId to the command line, and still complain about it.

Failure Logs

npx nx e2e myapp-e2e --ciBuildId='12345'

> nx run myapp-e2e:e2e --ciBuildId=12345
Property 'ciBuildId' does not match the schema. '12345' should be a 'string'.

Environment

Node : 16.0.0 OS : win32 x64 npm : 7.10.0

nx : Not Found @nrwl/angular : 11.6.1 @nrwl/cli : 11.6.1 @nrwl/cypress : 11.6.1 @nrwl/devkit : 11.6.1 @nrwl/eslint-plugin-nx : 11.6.1 @nrwl/express : Not Found @nrwl/jest : 11.6.1 @nrwl/linter : 11.6.1 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 11.6.1 @nrwl/web : Not Found @nrwl/workspace : 11.6.1 @nrwl/storybook : 11.6.1 @nrwl/gatsby : Not Found typescript : 4.1.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

2reactions
aieceecommented, Dec 20, 2021

I found that changing the name in the azure pipelines yaml file fixed this for us. Setting it like this allowed it to run correctly. name: $(TeamProject)_$(Build.DefinitionName)_$(Build.BuildId)

From what I can tell azure sets the build id to the name you specified. This is currently running for us nightly so can confirm it works

0reactions
github-actions[bot]commented, Aug 7, 2022

This issue has been automatically marked as stale because it hasn’t had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to detect ciBuildId for Jenkins or run in --parallel #2346
Running my specs in Jenkins I get this error: 12:10:32 cypress-tests | You passed the --group or --parallel flag but we could not ......
Read more >
Good error messages - Cypress
These include failed assertions during tests (after all, Cypress is an end to end test runner), and crashes inside our application.
Read more >
Cypress tests are green locally, but failing in CI - Stack Overflow
I tried to use cypress-failed-log plugin to see command log, but that does not really help because it's the same thing I see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found