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

[test] Use test-utils from npm #12880

Merged
merged 14 commits into from
May 29, 2024
Merged

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Apr 23, 2024

Using test-utils from an npm package instead of monorepo.

A couple of additional changes were needed:

  • tsconfig's moduleResolution was set to bundler to enable reading package.json exports field
  • @testing-library/react was upgraded to 15.0.7 to match the version from the test-utils
  • @types/react-dom were upgraded to 18.2.25 (the previous version did not contain a type used by testing-library)

To be merged after mui/material-ui#41177 is merged and published.

@michaldudak michaldudak added test scope: code-infra Specific to the core-infra product labels Apr 23, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 24, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 27, 2024
@mui-bot
Copy link

mui-bot commented May 27, 2024

Deploy preview: https://deploy-preview-12880--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against b45fcc3

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Nice! 👏

pnpm-lock.yaml Show resolved Hide resolved
pnpm-lock.yaml Outdated Show resolved Hide resolved
@michaldudak
Copy link
Member Author

michaldudak commented May 27, 2024

The failing tests are most likely not related to this PR, as they also fail when the monorepo is updated to next (#13086). The out-of-memory error on CI is a bit worrying, though.

I'd appreciate any assistance with these.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 28, 2024

This comment was marked as resolved.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 28, 2024
@LukasTy
Copy link
Member

LukasTy commented May 29, 2024

It's clear that the explicit memory limit increase is needed as before it the CPU is pegged doing too much GC. 🙈

Before

Screenshot 2024-05-29 at 09 03 34

After

Screenshot 2024-05-29 at 09 05 37

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 29, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 29, 2024
@michaldudak michaldudak marked this pull request as ready for review May 29, 2024 08:45
@michaldudak
Copy link
Member Author

mui/material-ui#41177 has been merged and @mui/internal-test-utils is published to npm with version 1.0.0-dev.20240529-082515-213b5e33ab

@@ -6,7 +6,7 @@
"commitMessageTopic": "{{depName}}",
"dependencyDashboard": true,
"rebaseWhen": "conflicted",
"ignoreDeps": ["jsdom"],
"ignoreDeps": [],
Copy link
Member

Choose a reason for hiding this comment

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

@cherniavskii On the latest major they reverted a change that initially reduced the performance
https://github.com/jsdom/jsdom/releases/tag/24.0.0

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

LGTM! 👏
Thanks for the effort. 💙

I've also updated jsdom and ran dedupe to reduce amount of duplicate packages, which were introduced for some reason. 🙈

Do you have any idea why argos reacted like there is no reference build and treats all screenshots as new? 🤔 🤷

@michaldudak
Copy link
Member Author

Do you have any idea why argos reacted like there is no reference build and treats all screenshots as new? 🤔 🤷

It looks like an issue on Argos' side. I started seeing it in other PRs as well.

@LukasTy LukasTy merged commit 7269ea0 into mui:master May 29, 2024
17 checks passed
@@ -32,7 +32,7 @@
"size:why": "pnpm size:snapshot --analyze --accurateBundles",
"tc": "node test/cli.js",
"test": "node scripts/test.mjs",
"test:coverage": "cross-env NODE_ENV=test TZ=UTC BABEL_ENV=coverage nyc mocha --exclude '**/node_modules/**' && nyc report -r lcovonly",
"test:coverage": "cross-env NODE_OPTIONS=--max-old-space-size=4096 NODE_ENV=test TZ=UTC BABEL_ENV=coverage nyc mocha --exclude '**/node_modules/**' && nyc report -r lcovonly",
Copy link
Member

Choose a reason for hiding this comment

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

@LukasTy How did you manage to make the test_unit pass? It failed even when I added this flag here

Copy link
Member

Choose a reason for hiding this comment

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

Did it? I saw them passing even before bumping jsdom... 🤷
https://app.circleci.com/pipelines/github/mui/mui-x?branch=pull%2F12880

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, I think I didn't wait for the result after my last commit, and for some reason assumed it failed 😅
All good then 👍🏻

Copy link
Member

Choose a reason for hiding this comment

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

P.S. Here is my comment comparing your commits behavior on the system resources. 😉
#12880 (comment)

@michaldudak michaldudak deleted the test-utils-package branch May 29, 2024 13:10
@@ -48,6 +48,7 @@
},
"dependencies": {
"@babel/runtime": "^7.24.5",
"@mui/internal-test-utils": "1.0.0-dev.20240529-082515-213b5e33ab",
Copy link

@AviVahl AviVahl May 30, 2024

Choose a reason for hiding this comment

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

@LukasTy this was added as a dependency, causing consumers to get this, and many others deps, installed.
this addition causes peerDep errors (about babel missing and react@18 not supported) on our end.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for raising this! 🙏
An issue has also been created for it: #13317.

Copy link
Member

Choose a reason for hiding this comment

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

@LukasTy LukasTy mentioned this pull request Jun 14, 2024
DungTiger pushed a commit to DungTiger/mui-x that referenced this pull request Jul 23, 2024
Co-authored-by: Andrew Cherniavskyi <[email protected]>
Co-authored-by: Lukas <[email protected]>
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Co-authored-by: Andrew Cherniavskyi <[email protected]>
Co-authored-by: Lukas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants