-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
upgrade jest #15642
upgrade jest #15642
Conversation
2ed42b8
to
6691a0b
Compare
Builds ready [d5eefb4]
Page Load Metrics (1847 ± 60 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will re-approve once the merge conflicts are resolved.
d5eefb4
to
7ede140
Compare
Builds ready [7ede140]
Page Load Metrics (1826 ± 76 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per our slack conversation I think we can probably remove the ui/components/ui/button/button.stories.skippedtest.js
file altogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Builds ready [206510f]
Page Load Metrics (2182 ± 137 ms)
|
// installed in @metamask/controllers so I had to just blanket specify all | ||
// of the @metamask/controllers folder. | ||
transformIgnorePatterns: [ | ||
'/node_modules/(?!(multiformats|uuid|nanoid|@metamask/controllers|@metamask/snap-controllers)/)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiformats
, uuid
, and nanoid
makes sense, because they have recently(ish) converted to ESM, and I've seen Jest choke on these packages in other projects.
We don't ship ESM code in @metamask/controllers
or @metamask/snap-controllers
, however, so why did we have to list these here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of the dependencies nested inside the metamask/controllers repo are ESM and i could not figure out how to specify that recursion in this ignore pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. Interesting...
+++ b/node_modules/@types/jsdom/node_modules/parse5/dist/index.d.ts | ||
@@ -1,10 +1,10 @@ | ||
-import { type ParserOptions } from './parser/index.js'; | ||
+import { ParserOptions } from './parser/index.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry why do we have to remove type
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running tsc throws errors for using type keyword inside the brackets. You can import types and non types without specifying a keyword
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh... wow. That's subtle. How do other people even use this package then 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea. unless it has something to do with our setup.
Had to do a bit of research on this one. Looks like the next version of Jest includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
Explanation
Fixes issue related to slack reports of unit tests consuming upwards of more than 20gb of memory and 4gb of swap. Note that this PR does nothing to fix the underlying memory leaks in our tests and that should be explored separately. This works around the memory issue by forcing worker processes to terminate once they've consumed 500mb of memory. I chose 500mb because our ci environment has 4gb of ram and we run two workers when running tests in jest. This would allow us to theoretically add another 6 workers without running into out of memory issues. I'll test that theory in another PR aimed at improving CI.
Consequences of this PR:
import { type TypeName}
syntaxPre-Merge Checklist
+ If there are functional changes: