Skip to content
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

Setting CYPRESS_ENV to something other than production returns a cryptic error #1978

Closed
MichaelHindley opened this issue Jun 18, 2018 · 3 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@MichaelHindley
Copy link

MichaelHindley commented Jun 18, 2018

Current behaviour:

If you invoke cypress.run() with record: true with the CYPRESS_ENV env variable set to something different than production, Cypress will fail with a cryptic message:

Warning: We encountered an error talking to our servers.

This run will not be recorded.

This error will not alter the exit code.

RequestError: Error: Invalid URI "/runs"

Desired behavior:

Warning: You are trying to record a test run in a non-production environment.  
This is not supported and this run will not be recorded.

Check the CYPRESS_ENV variable if behaviour is undesirable in the context of this run.

This warning will not alter the exit code.

Steps to reproduce:

Run Cypress with CYPRESS_ENV set to something like dev, with record: true and key: 'key'

Versions

3.0.1 on

  • macOS 10.13.5
  • Debian 8
@MichaelHindley MichaelHindley changed the title Setting CYPRESS_ENV to something other than production returns in cryptic error Setting CYPRESS_ENV to something other than production returns a cryptic error Jun 18, 2018
@jennifer-shehane
Copy link
Member

What are you trying to achieve by setting the CYPRESS_ENV key to dev?

CYPRESS_ENV is an internal key used by Cypress and I thought we had updated the error messages to better handle this @bahmutov - but this is a very cryptic error message.

@brian-mann brian-mann added the type: duplicate This issue or pull request already exists label Jun 18, 2018
@brian-mann
Copy link
Member

This is actually already in a PR and is a duplicate issue. #1626

#1621

@MichaelHindley
Copy link
Author

Ah great :)

@jennifer-shehane was thinking about using it to match our general environments such as dev, test, stage, prod and ran into this issue- didn't realise it's not ment to be used when consuming, thanks for the heads up! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants