ci: follow vitest 5's project uniqueness and blob report path

Two breakages that the typecheck failure was hiding, since every step after it
in the "Test development" job was skipped and the CKEditor job never got as far
as uploading anything.

The root config globs both `packages/*/vitest.config.ts` and
`packages/*/vite.config.ts`. ckeditor5 is the only package with both, and its
vite.config.ts merely builds the library — it declares no tests at all. Vitest 4
registered it anyway as a second project sharing the package's name; vitest 5
rejects the duplicate outright and `pnpm scripts:test` cannot start:

    Error: Project name "@triliumnext/ckeditor5" from
    "packages/ckeditor5/vitest.config.ts" is not unique.

Blob reports also moved from `.vitest-reports/` to `.vitest/blob/`, alongside
the attachments that moved to `.vitest/`. The shard jobs were writing them where
nothing looked, so the upload failed with "No files were found" — after the
tests themselves had passed. The merge job reads the same path and would have
failed next.

Verified by running what CI runs: both shards, then `--mergeReports --coverage`,
which replays 127 files / 1626 tests and clears the gate at
99.91/99.54/100/99.98.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Elian Doran 2026-09-07 23:31:58 +02:00
parent 1d94f21272
commit fc7b6a6846
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View File

@ -452,7 +452,7 @@ jobs:
--coverage.thresholds.lines=0 --coverage.thresholds.functions=0 \
--coverage.thresholds.branches=0 --coverage.thresholds.statements=0
# Vitest names blobs `.vitest-reports/blob-<index>-<count>.json`, so the two
# Vitest names blobs `.vitest/blob/blob-<index>-<count>.json`, so the two
# shards produce distinct filenames and merge-multiple cannot clobber them.
# That directory is dot-prefixed, and upload-artifact skips hidden paths
# unless told otherwise — without include-hidden-files it silently matches
@ -462,7 +462,7 @@ jobs:
if: ${{ !cancelled() && steps.test-ckeditor5.outcome == 'success' }}
with:
name: ckeditor5-blob-${{ matrix.shard }}
path: packages/ckeditor5/.vitest-reports/
path: packages/ckeditor5/.vitest/blob/
include-hidden-files: true
if-no-files-found: error
retention-days: 1
@ -500,7 +500,7 @@ jobs:
with:
pattern: ckeditor5-blob-*
merge-multiple: true
path: packages/ckeditor5/.vitest-reports
path: packages/ckeditor5/.vitest/blob
# Re-runs no tests; it replays the blobs to produce the junit and lcov
# output and to evaluate the package's real coverage thresholds over the

View File

@ -5,6 +5,10 @@ export default defineConfig({
projects: [
"packages/*/vitest.config.ts",
"packages/*/vite.config.ts",
// ckeditor5 is the one package with both, and its vite.config.ts only builds the library —
// the tests live in vitest.config.ts. Registering both gives two projects called
// "@triliumnext/ckeditor5", which vitest rejects.
"!packages/ckeditor5/vite.config.ts",
"apps/*/vitest.config.ts",
"apps/*/vite.config.ts",
"apps/*/vite.config.mts",