Better handle reserved key CYPRESS_ENV being set by users to va… (#6437)

* Add warning when setting CYPRESS_ENV to non-production value

* Add warning and update error when setting CYPRESS_ENV in config to non-production value

* Update config test/to throw

* we want warning, not throw

* Rename env var to CYPRESS_INTERNAL_ENV + fix warning to actually warn when staging

* update cli snapshot to include new 'info' command

* yarn.lock

* removed the warning from config, is overboard on our own tests 😓

* cleanup from review

Co-authored-by: Gleb Bahmutov <gleb.bahmutov@gmail.com>
This commit is contained in:
Jennifer Shehane
2020-03-06 16:53:48 +06:30
committed by GitHub
parent e93e6ae0b4
commit 2ba53f6837
33 changed files with 1540 additions and 2237 deletions

View File

@@ -148,7 +148,7 @@ buildCypressApp = (platform, version, options = {}) ->
})
.then =>
str = """
process.env.CYPRESS_ENV = process.env.CYPRESS_ENV || 'production'
process.env.CYPRESS_INTERNAL_ENV = process.env.CYPRESS_INTERNAL_ENV || 'production'
require('./packages/server')
"""

View File

@@ -49,7 +49,7 @@ runProjectTest = (buildAppExecutable, e2e) ->
console.log("running project test")
new Promise (resolve, reject) ->
env = _.omit(process.env, "CYPRESS_ENV")
env = _.omit(process.env, "CYPRESS_INTERNAL_ENV")
if !canRecordVideo()
console.log("cannot record video on this platform yet, disabling")
@@ -92,7 +92,7 @@ runFailingProjectTest = (buildAppExecutable, e2e) ->
spawn = ->
new Promise (resolve, reject) ->
env = _.omit(process.env, "CYPRESS_ENV")
env = _.omit(process.env, "CYPRESS_INTERNAL_ENV")
args = [
"--run-project=#{e2e}",