Cypress end-to-end test fails when ciBuildId is parseable as number
See original GitHub issueWhen 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:
- Created 2 years ago
- Reactions:3
- Comments:7
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
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! 🙏