Skip to content

Commit 061b6b3

Browse files
authored
fix(ci): enable coverage collection in sharded unit test runs (#1034)
The coverage report on PRs was empty (0/0 Unknown%) because the sharded unit-test jobs ran without --coverage. Without that flag, V8 coverage data is never collected, so the blob reports contain no coverage maps. The merge-reports step then merges undefined entries and produces empty results. Also fixes the coverage report action referencing a nonexistent vitest.unit.config.ts (should be vitest.config.ts).
1 parent d3b412f commit 061b6b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- run: npm ci
8888
- run: npm run build --if-present
8989
- name: Run unit tests (shard ${{ matrix.shard }})
90-
run: npx vitest run --project unit --shard=${{ matrix.shard }} --reporter=blob --reporter=verbose
90+
run: npx vitest run --project unit --shard=${{ matrix.shard }} --reporter=blob --reporter=verbose --coverage
9191
- name: Upload blob report
9292
if: always()
9393
uses: actions/upload-artifact@v7
@@ -144,6 +144,6 @@ jobs:
144144
with:
145145
json-summary-path: coverage/coverage-summary.json
146146
json-final-path: coverage/coverage-final.json
147-
vite-config-path: vitest.unit.config.ts
147+
vite-config-path: vitest.config.ts
148148
file-coverage-mode: none
149149
coverage-thresholds: '{ "lines": 50, "branches": 50, "functions": 50, "statements": 50 }'

0 commit comments

Comments
 (0)