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

ci: enable jest --shard option in github-actions #4545

Merged
merged 4 commits into from
Aug 29, 2022
Merged

ci: enable jest --shard option in github-actions #4545

merged 4 commits into from
Aug 29, 2022

Conversation

chimurai
Copy link
Contributor

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

x

Motivation / Use-Case

Speed up CI with jest v28 --shard option.

Example CI run with --shard enabled: https://github.com/chimurai/webpack-dev-server/actions/runs/2897917138

jest-1-4
jest-2-4
jest-3-4
jest-4-4

Breaking Changes

x

Additional Info

  • bump jest to v28
  • fix deprecated testURL in jest.config.js
  • fix uuid "export" issue with moduleNameMapper
  • enable --shard in .github/workflows/nodejs.yml

⚠️ Note: Not sure if codecov merges code coverage automatically. Otherwise additional steps are needed to merge the code coverage from the sharded tests.

@chimurai chimurai changed the title ci: enable jest --shard option github-actions ci: enable jest --shard option in github-actions Aug 21, 2022
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #4545 (2c74575) into master (751214a) will increase coverage by 0.12%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4545      +/-   ##
==========================================
+ Coverage   92.11%   92.24%   +0.12%     
==========================================
  Files          16       16              
  Lines        1637     1637              
  Branches      616      616              
==========================================
+ Hits         1508     1510       +2     
+ Misses        118      116       -2     
  Partials       11       11              
Impacted Files Coverage Δ
lib/servers/WebsocketServer.js 94.87% <0.00%> (+5.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chimurai
Copy link
Contributor Author

chimurai commented Aug 27, 2022

Branch/PR Status checks that are required. need to be updated due to Jest shards.
(webpack-dev-server > settings > branches > Branch protection rules > Require status checks to pass before merging)

I can also update/downgrade the PR to just Jest v28 update, if you want to have sharding in a separate PR.

@alexander-akait
Copy link
Member

Big thank you for a work

@alexander-akait alexander-akait merged commit 4eed30e into webpack:master Aug 29, 2022
@alexander-akait
Copy link
Member

@chimurai I think we can do the same for webapck-cli and webpack itself, because tests are really long

@chimurai chimurai deleted the jest28 branch September 6, 2022 18:15
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.

2 participants