-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't pass hash values containing exponential operators to --env command line option. #6891
Can't pass hash values containing exponential operators to --env command line option. #6891
Comments
I was able to confirm this behavior running locally on 4.1 and 4.3. Passing a string OR a number is fine, but a hash comes through as null. |
Logged in plugins file configuration, the value is showing as Logged in Settings - Configuration panel, the value is showing as Infinity 😅 Basically this value is being converted to a Number - due to the For example, lodash considers this a number. The transformation from the actual value to a Number (specifically Infinity) happens through this method: https://github.com/cypress-io/cypress/blob/test-retries/packages/server/lib/util/args.js#L234 You can see if you log the value before and after that function that it's transformed to this value. The root culprit is actually this call here where it's calling https://github.com/cypress-io/cypress/blob/test-retries/packages/server/lib/util/args.js#L85:L85 It seems like the code has always been this way - I traced this code being here at least 2 years, so this is likely a very rare edge case. |
I'm not really sure that I'll have time to address this, but the thought on how to handle this was to do a regex check for exponential operators and transform them to a string. |
Hey @jennifer-shehane, I can start working on this issue. For this, I can check for infinity (Both negative and positive) after the value is parsed |
The code for this is done in cypress-io/cypress#8051, but has yet to be released. We'll update this issue and reference the changelog when it's released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
We use
--env
variable to pass some environment variables to cypress, when it's running both in headless and headed mode.One of the parameters is a hash (mix of numbers and characters). Surprisingly some specific hash values make cypress to fail reading this value from the command line (e.g.
769e98018
). The corresponding environment variable is not set and theCypress.env()
function returns withnull
.Desired behavior:
It should not be a problem to read a hash from the command line and put into an environment variable.
Test code to reproduce
A simplified command line call:
Test code showing the issue:
This test fails with: 'expected null to equal 769e98018'
If I remove the 'e' character for example, then the value is read correctly.
Versions
Cypress 4.1.0
OpenSUSE 15.1 and Ubuntu 18.04
The text was updated successfully, but these errors were encountered: