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

fix(testing): avoid overwriting environment variables in nx cypress preset #20748

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

AgentEnder
Copy link
Member

Current Behavior

The nxCypressPreset function sets e2e.env - this overwrites the base env argument if its present in cypress config, and thus breaks things for users.

Expected Behavior

The preset and plugin communicate without setting extra things on the env. However, some stuff still goes through the env because we can set that on the CLI easily. Because of this, we need to support reading from the env, and just avoid writing anything to the env in the file.

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner December 13, 2023 17:34
Copy link

vercel bot commented Dec 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Dec 14, 2023 4:00pm

@AgentEnder AgentEnder force-pushed the fix/cypress-env branch 2 times, most recently from cde4f2f to f068625 Compare December 14, 2023 14:42
Comment on lines -95 to 112
env: {

[NX_PLUGIN_OPTIONS]: {
webServerCommand: options?.webServerCommands?.default,
webServerCommands: options?.webServerCommands,
ciWebServerCommand: options?.ciWebServerCommand,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: does cypress ever validate the config? wonder if this will through? doesn't seem to currently, but something to keep in mind. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they don't currently validate it. We'll keep an eye on it when migrating to new versions. Thanks Caleb 🎉

@AgentEnder AgentEnder merged commit d047ad5 into nrwl:master Dec 14, 2023
2 checks passed
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants