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(component-testing): Fix webpack-dev-server deps validation crash #15708

Merged
merged 15 commits into from
Apr 2, 2021

Conversation

dmtrKovalenko
Copy link
Contributor

This fixes issue https://cypress-io.atlassian.net/browse/CT-391

Actually, there was a small problem related to next v10 that was fixed here, but the weird error is coming from webpack-dev-server peer dependencies validation which was crashing this installation.

I cleaned it up a little bit to 1) make sure that we always use real peer dependencies 2) reduce the amount of code and add better types. But I doubt that we need this, nodejs will throw an explicit error if dependencies are missing but we are running this validation on each start for each run on CI and as far I know (not 100% sure) require under try { } catch will always be deoptimized and won't be cached and overall [require](https://kevin.burke.dev/kevin/node-require-is-dog-slow] is a really slow operation. So maybe we can delete this validation? What do you think @JessicaSachs

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 30, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Mar 30, 2021



Test summary

9394 0 119 3Flakiness 1


Run details

Project cypress
Status Passed
Commit 3607477
Started Apr 2, 2021 2:04 PM
Ended Apr 2, 2021 2:15 PM
Duration 11:35 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

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

agg23
agg23 previously approved these changes Mar 30, 2021
npm/webpack-dev-server/src/errors.ts Outdated Show resolved Hide resolved
avoid importing package.json so that it is not analyzed
@dmtrKovalenko dmtrKovalenko marked this pull request as draft March 30, 2021 17:27
@dmtrKovalenko dmtrKovalenko marked this pull request as ready for review March 31, 2021 10:43
@dmtrKovalenko
Copy link
Contributor Author

I decided to delete this test that using NEXT_DATA global because it is diving too deep into next's internal implementation. Originally testing components with router usage should be a bad practice, but using more and more internal APIs is even worse because this test will fail for literally all users between next's releases

@lmiller1990 lmiller1990 self-requested a review April 2, 2021 11:03
lmiller1990
lmiller1990 previously approved these changes Apr 2, 2021
elevatebart
elevatebart previously approved these changes Apr 2, 2021
Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

I have 2 non blocking comments.
LGTM

npm/webpack-dev-server/src/startServer.ts Outdated Show resolved Hide resolved
npm/webpack-dev-server/tsconfig.json Outdated Show resolved Hide resolved
@elevatebart elevatebart dismissed stale reviews from lmiller1990 and themself via 3607477 April 2, 2021 13:52
@elevatebart elevatebart changed the title fix(component-testing): Fix webpack-dev-server deps validation crash fix(component-testing): Fix webpack-dev-server deps validation crash Apr 2, 2021
@elevatebart elevatebart merged commit 254eb47 into develop Apr 2, 2021
@elevatebart elevatebart deleted the feat/next-js-v-10 branch April 2, 2021 15:13
@JessicaSachs JessicaSachs restored the feat/next-js-v-10 branch April 2, 2021 15:52
@emilyrohrbough emilyrohrbough deleted the feat/next-js-v-10 branch August 1, 2024 13:51
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.

4 participants