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: move node 17 Check from Binary to CLI #19977

Merged
merged 11 commits into from Jan 31, 2022
Merged

Conversation

emilyrohrbough
Copy link
Member

Move logic for determining whether or not the --openssl-legacy-provider flag should be passed for Node17 built with OpenSSL v3+ from binary to CLI package. The last change to check for OpenSSL version is checking the version of Node process bundled with Cypress, not the system Node process on the user's machine. This caused the check to be false and always skip adding the --openssl-legacy-provider flag when the system node version is Node 17 built with OpenSSL v3+.

Moving this logic aligns with where we determine the system Node version and parse the ORIGINAL_NODE_OPTIONS.

I have updated the cypress-test-node-versions repository to perform a simple test to verify that run mode works as expected. PR. You can verify the commit with this change builds successfully with Node 17.

User facing changelog

  • Fix regression in 9.3.0 where the bundled Node process was checked to determine if the --openssl-legacy-provider flag should be passed the plugins' child process. This always resolved to Cypress's bundled Node version of 16.5.0 which was built with OpenSSL v1, when it should have been checking the system Node process's OpenSSL version. Fixes #19712.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [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?

@emilyrohrbough emilyrohrbough requested a review from a team as a code owner January 31, 2022 15:47
@emilyrohrbough emilyrohrbough requested review from jennifer-shehane and removed request for a team January 31, 2022 15:47
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 31, 2022

Thanks for taking the time to open a PR!

@emilyrohrbough emilyrohrbough changed the title Move Node 17 Check from Binary to CLI to ensure correct node process is verified fix: move node 17 Check from Binary to CLI Jan 31, 2022
@jennifer-shehane jennifer-shehane removed their request for review January 31, 2022 15:52
@cypress
Copy link

cypress bot commented Jan 31, 2022



Test summary

19173 0 218 0Flakiness 3


Run details

Project cypress
Status Passed
Commit 5d89760
Started Jan 31, 2022 5:24 PM
Ended Jan 31, 2022 5:35 PM
Duration 11:43 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/cypress/proxy-logging_spec.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code
2 Proxy Logging > request logging > xhr log has response body/status code
3 ... > works with forceNetworkError

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

@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
# npx lint-staged
Copy link
Member

Choose a reason for hiding this comment

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

Did you intend to check this in?

Copy link
Member Author

Choose a reason for hiding this comment

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

lol no..This was when I push the pre-tested changes up.

cli/lib/util.js Outdated
@@ -286,14 +288,29 @@ const util = {
.value()
},

getOriginalNodeOptions (options) {
getOriginalNodeOptions ({ processVersions }) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you get proccess.versions here instead of passing it in? Is this called with the same node version that launched the cli?

}

return {}
return opts
Copy link
Member

Choose a reason for hiding this comment

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

what does this return value get used for? Previously it always returned an empty object, but now we actually return stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

previously in the if process.env.NODE_OPTIONS check it'd return fast with

{ ORIGINAL_NODE_OPTIONS: ... }

This removed the fast-return to got through both checks before returning. If neither check are hit, it'll continue to return an empty object.

@BlueWinds BlueWinds requested review from tbiethman and ryanthemanuel and removed request for tbiethman January 31, 2022 17:07
@emilyrohrbough emilyrohrbough merged commit 99f2486 into develop Jan 31, 2022
@emilyrohrbough emilyrohrbough deleted the node-17-maybe branch January 31, 2022 18:03
tgriesser added a commit that referenced this pull request Jan 31, 2022
* develop:
  fix: move node 17 Check from Binary to CLI (#19977)
  fix: send click event with `cy.type('{enter}')`. (#19726)
  chore: Update Chrome (beta) to 98.0.4758.74
tgriesser added a commit that referenced this pull request Feb 1, 2022
* 10.0-release:
  fix: restore @lmiller1990's changes
  feat: styling snapshots (#19972)
  fix bad merge overrides- GOOD CATCH TYLER!
  fix(unify): Updating reporter to consistently use app-provided "Preferred Editor" dialog (#19933)
  fix: move node 17 Check from Binary to CLI (#19977)
  fix: pass correct spec URL in `cypress run` on Windows (#19890)
  fix: send click event with `cy.type('{enter}')`. (#19726)
  feat: detect package manager in wizard (#19960)
  fix: refactor set specs by specPattern (#19953)
  chore: Update Chrome (beta) to 98.0.4758.74
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.

Cypress 9.2.1 + Node 17.1 (Win 11) Fails/Errors When Attempting Any Test
3 participants