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: Register and run default preprocessor in child process #8826

Merged
merged 9 commits into from
Oct 14, 2020

Conversation

chrisbreiding
Copy link
Contributor

@chrisbreiding chrisbreiding commented Oct 13, 2020

User facing changelog

  • Fixed an issue where certain preprocessor-related plugins would cause tests not to run and a duplicate instance of Cypress to be spawned.

Additional details

We run user-registered file preprocessors in the plugins child process, but when the user hasn't registered their own prepocessor, we register the default preprocessor in the main Cypress process. This causes issues with preprocessor-related plugins like Istanbul that use process.execPath to execute code because process.execPath is the Cypress binary in the main process and not node.

This fixes that by always registering and running the preprocessor in the child process, even our own default preprocessor.

Also, we used to not create the plugins child process if the user didn't have a plugins file. Now we always create it since it is necessary for running the default preprocessor.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • N/A Has a PR for user-facing changes been opened in cypress-documentation?
  • N/A Have API changes been updated in the type definitions?
  • N/A Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 13, 2020

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Oct 13, 2020



Test summary

8614 0 124 3


Run details

Project cypress
Status Passed
Commit dd926f2
Started Oct 14, 2020 4:15 PM
Ended Oct 14, 2020 4:26 PM
Duration 11:43 💡
OS Linux Debian - 10.2
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

flotwig
flotwig previously approved these changes Oct 13, 2020
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +19 to +28
const deferred = () => {
let reject
let resolve
const promise = new Promise((_resolve, _reject) => {
resolve = _resolve
reject = _reject
})

return { promise, resolve, reject }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

could also use Bluebird.defer, it's deprecated but i won't tell 🤫

@jennifer-shehane
Copy link
Member

This PR introduced a new issue: #8864

@jennifer-shehane
Copy link
Member

This PR introduced this new issue: #9145

@jennifer-shehane
Copy link
Member

This PR introduced a new issue: #14587

@jennifer-shehane
Copy link
Member

This PR also introduced #9326

@chrisbreiding chrisbreiding deleted the TR-345-dual-cypress-bug branch April 5, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preprocessor opens another Cypress instance when bundling
3 participants