Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Make Jest unit tests run faster in GitHub actions (#25726)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25726?quickstart=1) Based on #25680, by migrating the jest unit tests from CircleCI to GitHub actions the time to run unit tests has increased to 15 minutes from 5 minutes. This PR makes Jest unit tests run faster in Github actions. This is achieved by some improvements to the testing infrastructure. 1. **Sharding**: the tests are run on 6 machines in parallel, instead of a single machine. This saves around ~8-9 minutes on average. 2. **Optimized coverage generation**: I removed the generation of html reports in CI, as they are only used for local debugging. This should also save some time, as unused files are not being generated on CI. 3. **Merged development tests**: The two small tests under `build/transforms` were merged into the main test configuration. This means that one less machine needs to be started (as the development tests would require their own machine to run, due to the sharding introduced in this PR), saving around approx. 2 minutes of compute time. 4. **Minor fixes**: Now the `run-unit-tests` workflow will also run on push to the `develop` and `master` branches. ## **Related issues** Fixes: #25680, ## **Manual testing steps** 1. Run CI and see that tests are running fast (between 5-7 mins on average) ## **Screenshots/Recordings** Not Applicable ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information