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

chore(tools): control Cypress installation #38660

Conversation

Copy link
Contributor

@ojeytonwilliams ojeytonwilliams commented Apr 27, 2020

It's oddly difficult to configure npm install. npm set config is lower priority than .npmrc and it only takes effect the next time you use npm install. As a result you can't use preinstall to disable the installation and you can't overwrite config set in .npmrc via npm config.

However, environment variables that are passed to the process supersede .npmrc, which is why I went with spawn a new process with the desired variable.

Closes #38636

Contributors will not need to install Cypress unless they are working on
e2e tests. With these changes it will only install when npm run cypress
is invoked.
@ojeytonwilliams ojeytonwilliams added the scope: tools/scripts label Apr 27, 2020
@ojeytonwilliams ojeytonwilliams requested a review from Apr 27, 2020
@gitpod-io
Copy link

@gitpod-io gitpod-io bot commented Apr 27, 2020

@ojeytonwilliams
Copy link
Contributor Author

@ojeytonwilliams ojeytonwilliams commented Apr 27, 2020

@raisedadead if we want to stop crash reports going to Cypress, we can, but it'll need to use cross-env for cypress and cypress:run. It doesn't work on precypress.

@raisedadead
Copy link
Member

@raisedadead raisedadead commented Apr 27, 2020

if we want to stop crash reports going to Cypress

Won't that be the case only where we have the CI env configured with the keys? Everywhere else it will just fail? Which is fine. Or I am missing something.

@ojeytonwilliams
Copy link
Contributor Author

@ojeytonwilliams ojeytonwilliams commented Apr 27, 2020

Sounds like they get error reports when Cypress itself crashes, so I think it'll send them regardless of keys, but I'm not sure. The docs are here if you want to take a look.

@raisedadead
Copy link
Member

@raisedadead raisedadead commented Apr 27, 2020

A quick look tells me this is mostly for analytics for their product? IDK to be honest, lets give this a go as is, unless you have any more changes to the PR.

@ojeytonwilliams
Copy link
Contributor Author

@ojeytonwilliams ojeytonwilliams commented Apr 28, 2020

I think so, too. And, yes, I'm happy with the PR.

@raisedadead raisedadead changed the title Chore(tools): control Cypress installation chore(tools): control Cypress installation Apr 28, 2020
@raisedadead raisedadead merged commit 33963cc into freeCodeCamp:master Apr 28, 2020
2 checks passed
@ojeytonwilliams ojeytonwilliams deleted the chore/control-cypress-installation branch Apr 28, 2020
raisedadead added a commit that referenced this issue Apr 29, 2020
abbathaw pushed a commit to abbathaw/freeCodeCamp that referenced this issue Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: tools/scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants