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 jsdom #31751
Upgrade jsdom #31751
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #31751 +/- ##
==========================================
+ Coverage 74.15% 74.23% +0.07%
==========================================
Files 2914 2911 -3
Lines 103970 103567 -403
Branches 12889 12868 -21
==========================================
- Hits 77103 76882 -221
+ Misses 21039 20857 -182
Partials 5828 5828
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
af83c23
to
1b75280
Compare
Codenotify: Notifying subscribers in CODENOTIFY files for diff ed6cdc7...8f04789.
|
@@ -92,11 +93,11 @@ export const logout = createAsyncThunk( | |||
async (redirectUrl: string | undefined, { dispatch, rejectWithValue }) => { | |||
try { | |||
await deleteSession(); | |||
await dispatch(clearCurrentUser()); | |||
dispatch(clearCurrentUser()); |
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.
clearCurrentUser
is sync
import { parse } from "metabase-lib/expressions/recursive-parser"; | ||
|
||
import { generateExpression } from "./generator"; | ||
|
||
const fuzz = process.env.MB_FUZZ ? describe : describe.skip; | ||
const fuzz = process.env.MB_FUZZ ? describe : _.noop; |
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.
what's the reason behind this change? Changing from describe.something
to _.noop
looks questionable since that affects the test output.
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.
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.
love this change
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.
Does that help improve the test time as well (2186s -> 1652s)? that'll be another huge win.
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.
@WiNloSt I don't think it affects perf somehow, maybe runners were busy so the result was ~2k seconds, but overall with this jsdom upgrade we should have 1.7-1.8k seconds per run.
jest should definitely count those describe.skip, but to my mind it's just javascript, so 10s is more than enough to go through it
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.
works for me!
import { parse } from "metabase-lib/expressions/recursive-parser"; | ||
|
||
import { generateExpression } from "./generator"; | ||
|
||
const fuzz = process.env.MB_FUZZ ? describe : describe.skip; | ||
const fuzz = process.env.MB_FUZZ ? describe : _.noop; |
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.
love this change
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.
This doesn't bother me that much, but I don't see these wrapper methods being all that useful when we just have to remember to use them instead of the window.location
methods everyone already knows.
Does mocking the window.location methods directly not work with the new version of jsdom?
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.
answered here
one more time: unfortunately with latest jsdom it's not possible to mock window properties anymore (at least ways I tried didn't help)
No failed tests 🎉 |
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.
Great work!
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 👍
a03fdc7
to
869d25f
Compare
jsdom lib had a perf problem with getComputedStyle method, which is used a lot with css in js solutions. The problem was addressed in JSDOM 22.1.0, but jest itself waits for the major upgrade to take it into account. The temporary proposed solution is to use yarn resolutions.
jsdom lib had a perf problem with getComputedStyle method, which is used a lot with css in js solutions. The problem was addressed in JSDOM 22.1.0, but jest itself waits for the major upgrade to take it into account. The temporary proposed solution is to use yarn resolutions. Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Description
Upgrade allows to cut 1.5-2min from jest run.
jsdom lib had a perf problem with
getComputedStyle
method, which is used a lot with css in js solutions. The problem was addressed in JSDOM 22.1.0, but jest itself waits for the major upgrade to take it into account. The temporary proposed solution is to use yarn resolutions.Issues about no longer possible window manipulation in jsdom
jsdom/jsdom#3492
jsdom/jsdom#3492 (comment)
jestjs/jest#5124
The issue about perf investigation
jsdom/jsdom#3234