-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(ci): Balance frontend tests #30949
Conversation
size-limit report
|
b4a059e
to
b045362
Compare
} | ||
} | ||
|
||
module.exports = TestBalancer; |
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.
Can you write this in typescript as well?
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.
Not possible unfortunately: jestjs/jest#8810
Here's an example of frontend tests have wildly differing test sharding: frontend (0) taking 23 minutes |
I think this is useful enough to merge as-is - ideally we would add some automation to update the balance JSON file. But I think even without automating it, this should suffice for awhile (until we add new tests that are quite slow). Some automation ideas:
|
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.
looks great, I like this.
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.
🤞
|
||
mountGlobalModal(); | ||
screen.getByTestId('widget-add').click(); |
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.
should this be userEvent.click(screen.getByTestId('widget-add'))
?
|
||
mountGlobalModal(); | ||
screen.getByTestId('widget-add').click(); | ||
|
||
// Add a custom widget to the dashboard | ||
(await screen.findByText('Custom Widget')).click(); |
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.
here too?
This adds a jest reporter to record the test durations of our frontend tests. It also changes our runner to look for a results JSON and attempt to balance tests between our CI runners.