-
Notifications
You must be signed in to change notification settings - Fork 6
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
Environment Variables are lost when merging config files #57
Comments
@mncharlton @bahmutov I confirm I encountered the same issue. @mncharlton One question about your fix: if An example of the expected behavior: // base.json
{
"env": {
"myVar": "one"
}
}
// extended.json
{
"extends": "./base.json",
"env": {
"myVar": "two"
}
}
cypress run --config-file extended.json
// myVar === "two"
cypress run --config-file extended.json --env myVar="three"
// myVar === "tree" |
I don't know what the correct answer is to be honest 😅 |
I had issues with this issue as well. In my particular case what was happening is that on my CI/CD settings I had a scheduled job that was passing a custom value for CYPRESS_baseUrl. However, that value was getting overwritten by the merge plugin, and as well as other environment variables getting lost as mentioned in the comments above. In the end I resolved it by doing the following:
|
If you only need to fix this issue for
|
When using the plugin my environment variables are lost, I think because they aren't part of the actual config file, but are added to the config, they aren't included in the merged config file (which is purely the two config files, not anything else).
To get this to work for me, I wrote my own function, based on the plugin, that looks like this:
So it merges the config, the baseConfig, and the config file rather than just merging the two json files - this appears to work for me.
Happy to try and make a PR to update the plugin if this looks like something that would work for all cases/I'm not missing anything?
The text was updated successfully, but these errors were encountered: