Complete the vitest 5 upgrade and port maxForks to maxWorkers #127

Merged
ullrich merged 4 commits from vitest-5-complete-set into main 2026-09-07 14:53:57 +00:00
Owner

#121 merged @vitest/browser to ^5.0.0 on its own, leaving main with a split version set:

root          vitest                     ^4.1.10  -> 4.1.11
apps/planner  @vitest/browser            ^5.0.0   -> 5.0.0
apps/planner  @vitest/browser-playwright ^4.1.10  -> 4.1.11

@vitest/browser-playwright@4.1.11 pins "@vitest/browser": "4.1.11" exactly and peers "vitest": "4.1.11", so pnpm installed two parallel @vitest/browser trees — the split renovate.json5's #38 note exists to prevent.

It went green because the v5 copy was unused. The only source import is @vitest/browser-playwright, which resolved its own v4 copy, so the entire live chain stayed v4 while the 5.0.0 tree sat installed and idle. Green and wrong at once — the mismatch would have surfaced as a failure of #122, the browser-playwright bump, rather than of the change that caused it.

The fix

Takes vitest and @vitest/browser-playwright to ^5.0.0 so the whole release train matches. Verified the duplicate tree is gone and the exact peer is satisfied:

package resolved requires
vitest 5.0.0
@vitest/browser 5.0.0 peers vitest 5.0.0
@vitest/browser-playwright 5.0.0 needs @vitest/browser 5.0.0, peers vitest 5.0.0

It also ports #126's worker cap, which vitest 5 broke

vitest.shared.ts(60,5): error TS2769: No overload matches this call.
  Object literal may only specify known properties, and 'poolOptions' does
  not exist in type 'InlineConfig'.

vitest 5 removed poolOptions and replaced it with a top-level, pool-agnostic maxWorkers?: number | string. Two PRs that were each correct alone merged into a config that does not typecheck#126 was written against v4 while #121 was moving to v5. maxWorkers: 2 under CI restores the intended bound.

The two are not exactly equivalent — the old form capped forks per pool, the new one caps workers per project — but that is the same thing here, because nothing sets a non-default pool.

Verified

  • pnpm typecheck exit 0 (14 tasks)
  • pnpm lint exit 0
  • CI=1 TURBO_CONCURRENCY=3 pnpm test green across 12 tasks

Supersedes

#122 can be closed once this lands.

#121 merged `@vitest/browser` to `^5.0.0` on its own, leaving `main` with a split version set: ``` root vitest ^4.1.10 -> 4.1.11 apps/planner @vitest/browser ^5.0.0 -> 5.0.0 apps/planner @vitest/browser-playwright ^4.1.10 -> 4.1.11 ``` `@vitest/browser-playwright@4.1.11` pins `"@vitest/browser": "4.1.11"` exactly and peers `"vitest": "4.1.11"`, so pnpm installed **two parallel `@vitest/browser` trees** — the split `renovate.json5`'s #38 note exists to prevent. **It went green because the v5 copy was unused.** The only source import is `@vitest/browser-playwright`, which resolved its own v4 copy, so the entire live chain stayed v4 while the 5.0.0 tree sat installed and idle. Green and wrong at once — the mismatch would have surfaced as a failure of **#122**, the browser-playwright bump, rather than of the change that caused it. ### The fix Takes `vitest` and `@vitest/browser-playwright` to `^5.0.0` so the whole release train matches. Verified the duplicate tree is gone and the exact peer is satisfied: | package | resolved | requires | |---|---|---| | `vitest` | 5.0.0 | — | | `@vitest/browser` | 5.0.0 | peers `vitest 5.0.0` | | `@vitest/browser-playwright` | 5.0.0 | needs `@vitest/browser 5.0.0`, peers `vitest 5.0.0` | ### It also ports #126's worker cap, which vitest 5 broke ``` vitest.shared.ts(60,5): error TS2769: No overload matches this call. Object literal may only specify known properties, and 'poolOptions' does not exist in type 'InlineConfig'. ``` vitest 5 removed `poolOptions` and replaced it with a top-level, pool-agnostic `maxWorkers?: number | string`. **Two PRs that were each correct alone merged into a config that does not typecheck** — #126 was written against v4 while #121 was moving to v5. `maxWorkers: 2` under CI restores the intended bound. The two are not exactly equivalent — the old form capped forks per pool, the new one caps workers per project — but that is the same thing here, because nothing sets a non-default pool. ### Verified - `pnpm typecheck` exit 0 (14 tasks) - `pnpm lint` exit 0 - `CI=1 TURBO_CONCURRENCY=3 pnpm test` green across 12 tasks ### Supersedes **#122** can be closed once this lands.
Complete the vitest 5 upgrade and port maxForks to maxWorkers
Some checks failed
CD Staging / Build & Push Docker Images (pull_request) Has been skipped
CD Staging / Build & Push Docker Images-1 (pull_request) Has been skipped
CD Staging / Deploy Staging (pull_request) Has been skipped
CD Staging / Deploy PR Preview (pull_request) Has been skipped
CD Staging / Tear Down PR Preview (pull_request) Has been skipped
CI / Security Scan (pull_request) Successful in 1m18s
CI / Dockerfile Package Check (pull_request) Successful in 21s
CI / Checks (pull_request) Successful in 4m25s
CI / Visual Tests (pull_request) Failing after 1m37s
CI / E2E Tests (pull_request) Has been cancelled
CI / Journal Image Smoke Test (pull_request) Has been cancelled
e2fe5d80cf
#121 merged @vitest/browser to ^5.0.0 on its own, which left main with a split
version set:

  root          vitest                     ^4.1.10  -> 4.1.11
  apps/planner  @vitest/browser            ^5.0.0   -> 5.0.0
  apps/planner  @vitest/browser-playwright ^4.1.10  -> 4.1.11

@vitest/browser-playwright@4.1.11 pins "@vitest/browser": "4.1.11" exactly and
peers "vitest": "4.1.11", so pnpm installed TWO parallel @vitest/browser trees —
the split that renovate.json5's #38 note exists to prevent. It went green
because the only source import is @vitest/browser-playwright, which resolved its
own v4 copy, leaving the 5.0.0 tree installed but unused. Green and wrong: the
mismatch would have surfaced as a failure of #122, the browser-playwright bump,
rather than of the change that caused it.

Takes vitest and @vitest/browser-playwright to ^5.0.0 so the whole train
matches. Verified the duplicate tree is gone and the exact peer is satisfied:
vitest 5.0.0, @vitest/browser 5.0.0, @vitest/browser-playwright 5.0.0, which
needs @vitest/browser 5.0.0 and peers vitest 5.0.0.

ALSO PORTS THE #126 WORKER CAP, which vitest 5 broke:

  vitest.shared.ts(60,5): error TS2769: No overload matches this call.
    Object literal may only specify known properties, and 'poolOptions' does
    not exist in type 'InlineConfig'.

vitest 5 removed `poolOptions` and replaced it with a top-level, pool-agnostic
`maxWorkers?: number | string`. Two PRs that were each correct on their own
merged into a config that does not typecheck — #126 was written against v4 while
#121 was moving to v5. `maxWorkers: 2` under CI restores the intended bound. The
two are not exactly equivalent (the old form capped forks per pool, the new one
caps workers per project), but that is the same thing here because nothing sets
a non-default pool.

Verified: typecheck exit 0 (14 tasks), lint exit 0, and
`CI=1 TURBO_CONCURRENCY=3 pnpm test` green across 12 tasks.

Supersedes #122, which can be closed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W9K6hHEZx5aqyWZKHNrxsD
ci: follow vitest 5's move of the screenshot attachments directory
Some checks failed
CD Staging / Build & Push Docker Images (pull_request) Has been skipped
CD Staging / Build & Push Docker Images-1 (pull_request) Has been skipped
CD Staging / Deploy Staging (pull_request) Has been skipped
CD Staging / Deploy PR Preview (pull_request) Has been skipped
CD Staging / Tear Down PR Preview (pull_request) Has been skipped
CI / Security Scan (pull_request) Successful in 1m6s
CI / Dockerfile Package Check (pull_request) Successful in 37s
CI / Checks (pull_request) Successful in 8m16s
CI / Visual Tests (pull_request) Failing after 2m8s
CI / E2E Tests (pull_request) Has been cancelled
CI / Journal Image Smoke Test (pull_request) Has been cancelled
7c9e0434ac
vitest 5 writes failure attachments to `.vitest/attachments/` instead of
`.vitest-attachments/`. Both consumers still pointed at the old path, and both
failed quietly rather than loudly:

  find apps/planner/.vitest-attachments -name "*-diff-*.png"   -> no matches
  upload-artifact path: apps/planner/.vitest-attachments/       -> "No files
    were found with the provided path"

So the six genuine screenshot failures on this branch were still red, but the
evidence for them was thrown away: no diff comment on the PR and no
`visual-snapshots-diff` artifact to download. The step that reads worst in the
log — "Post diff comment on PR" — had in fact done its job and exited 0 with
nothing to post; the `exitcode '1'` beside it belongs to `test:visual` itself.

Also sets `if-no-files-found: ignore` on the upload. That step runs on ANY job
failure, including failures that produce no screenshots at all — a typecheck
error, or a browser that would not launch — and the default `warn` printed "No
files were found" against runs where no files were ever expected.

DELETES THE SIX DARWIN BASELINES. They are 912x154 and the linux ones are
483x81, while the canvas under test is declared `width={600} height={100}` and
drawn with `drawElevationChart(ctx, 600, 100, ...)`. Neither baseline matched
the element: vitest 4 captured a device-pixel-ratio-scaled box, which is why the
two platforms disagreed at all. vitest 5 captures the true CSS size, so both
platforms now produce 600x100 and the stored darwin files can never match again.
Deleted rather than left to fail every local `test:visual`; the first local run
writes fresh ones. The linux baselines are regenerated by the
"Update visual snapshots" workflow, which is the only place they can legitimately
come from.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W9K6hHEZx5aqyWZKHNrxsD
ci: pin the snapshot-update workflow's browser image in-repo
Some checks failed
CD Staging / Build & Push Docker Images (pull_request) Has been skipped
CD Staging / Build & Push Docker Images-1 (pull_request) Has been skipped
CD Staging / Deploy Staging (pull_request) Has been skipped
CD Staging / Deploy PR Preview (pull_request) Has been skipped
CD Staging / Tear Down PR Preview (pull_request) Has been skipped
CI / Security Scan (pull_request) Successful in 46s
CI / Dockerfile Package Check (pull_request) Successful in 19s
CI / Visual Tests (pull_request) Failing after 2m31s
CI / Checks (pull_request) Successful in 5m51s
CI / Journal Image Smoke Test (pull_request) Successful in 7m52s
CI / E2E Tests (pull_request) Successful in 4m8s
e02d760068
This job was still on `runs-on: playwright` — the runner-label-pinned image —
long after ci.yml's visual-tests and e2e jobs moved to an in-repo `container:`
declaration. That made it the last place the #38/#66 lockstep bug could bite,
and it did, on the first dispatch after the vitest 5 upgrade:

  browserType.launch: Executable doesn't exist at
    /ms-playwright/chromium_headless_shell-1234/chrome-headless-shell-linux64/...

A nasty shape, because this is the workflow that GENERATES the baselines. When
the runner image drifts from the lockfile's playwright, CI fails on a screenshot
mismatch AND the only sanctioned way to regenerate the baselines is broken by
the same drift — so the documented recovery path does not work precisely when
it is needed.

Now uses the same `mcr.microsoft.com/playwright:v1.62.1-noble` as the two CI
browser jobs, and carries the same "assert the image ships the browsers this
playwright needs" check. That check matters more here than anywhere else: this
job writes the baselines every other run is compared against, so a silent
browser mismatch would bake wrong pixels into the repo rather than merely fail.

Also corrects two header comments that still described `runs-on: playwright` as
the mechanism.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W9K6hHEZx5aqyWZKHNrxsD
ullrich force-pushed vitest-5-complete-set from 838a3dfa10 to 6d628d7ffa 2026-09-07 14:26:13 +00:00 Compare
ullrich force-pushed vitest-5-complete-set from 6d628d7ffa to 4fbebfa70f
All checks were successful
CD Staging / Build & Push Docker Images (pull_request) Has been skipped
CD Staging / Build & Push Docker Images-1 (pull_request) Has been skipped
CD Staging / Deploy Staging (pull_request) Has been skipped
CD Staging / Deploy PR Preview (pull_request) Has been skipped
CI / Dockerfile Package Check (pull_request) Successful in 16s
CI / Security Scan (pull_request) Successful in 1m25s
CI / Checks (pull_request) Successful in 2m24s
CI / Visual Tests (pull_request) Successful in 1m38s
CI / E2E Tests (pull_request) Successful in 7m38s
CI / Journal Image Smoke Test (pull_request) Successful in 14m16s
Cancel superseded CI / Cancel in-flight CI (pull_request) Successful in 15s
CD Staging / Tear Down PR Preview (pull_request) Successful in 28s
2026-09-07 14:36:14 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
trails-cool/trails!127
No description provided.