Skip to content

Conversation

@ddcc4
Copy link
Collaborator

@ddcc4 ddcc4 commented Dec 9, 2025

Overview

The app frontend unit tests take > 30 minutes to run nowadays, which slows me down greatly when I'm waiting for the CI tests to finish. This change takes advantage of Vitest's sharding functionality (--shard) to split the tests up and run them in parallel on multiple GitHub runners.

The idea is that each shard runs a subset of the frontend unit tests. Each runner produces a Vitest result file (via --reporter=blob) and a coverage result file. We upload those files to temporary GitHub workflow artifact storage.

Then another runner waits for all the shards to finish, downloads the shard results, and merges them into a single Vitest result (with vitest --merge-reports), and merges the coverage results into a single file to send to Codecov.

This PR also fixes a small bug:

Previously, we did not specify our Codecov token in the Upload coverage report step, so it was failing with the error Please upload with the Codecov repository upload token to resolve issue, but no one had noticed the problem before.

Test Plan and Hands on Testing

Tested manually by carefully watching the CI runs on this PR.

Risk assessment

Low.

@ddcc4 ddcc4 marked this pull request as ready for review December 9, 2025 23:19
@ddcc4 ddcc4 requested a review from a team as a code owner December 9, 2025 23:21
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.12%. Comparing base (90de9fc) to head (c9b7398).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             edge   #20341       +/-   ##
===========================================
+ Coverage   25.64%   57.12%   +31.47%     
===========================================
  Files        3639     3638        -1     
  Lines      302783   302719       -64     
  Branches    42297    42599      +302     
===========================================
+ Hits        77655   172918    +95263     
+ Misses     225104   129587    -95517     
- Partials       24      214      +190     
Flag Coverage Δ
app 46.34% <ø> (+45.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1842 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ddcc4 ddcc4 force-pushed the dc-shard-frontend-tests branch 4 times, most recently from 9ddc794 to 7e1c840 Compare December 10, 2025 01:09
@ddcc4 ddcc4 changed the title chore: shard the frontend unit tests on GitHub because they take too long chore(app): shard the frontend unit tests because they take too long Dec 10, 2025
@ddcc4 ddcc4 force-pushed the dc-shard-frontend-tests branch from 7e1c840 to f5a7bb4 Compare December 10, 2025 01:24
@ddcc4 ddcc4 force-pushed the dc-shard-frontend-tests branch from f5a7bb4 to c9b7398 Compare December 10, 2025 01:47
@ddcc4 ddcc4 requested review from jerader, sfoster1 and y3rsh December 10, 2025 01:48
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