Skip to content

Run Vitest in the browser shell - #351

Open
vanilla-wave wants to merge 35 commits into
mainfrom
t3code/vitest-browser-runner
Open

vanilla-wave wants to merge 35 commits into
mainfrom
t3code/vitest-browser-runner

Conversation

@vanilla-wave

@vanilla-wave vanilla-wave commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Vitest 4.1.11 / Vite 8.0.16 запускает TypeScript config/tests в браузерной shell: forks и threads, настоящий fail/fix reporter, exit1/0, npm test и verbose. Обычная конфигурация проекта, без rifty-патчей Vitest.

Реализованы process/Worker lifecycle, MessagePort keepalive, child startup preloads/conditions, VM offsets и builtin exports. Advanced IPC делает один native clone; бинарные serialized graphs явно отклоняются child_process.serialization.advanced.binary. Getter exceptions сохраняют identity; intrinsic clone errors имеют platform DataCloneError. Удалены custom Buffer codec, Promise probe и глобальный Proxy tracking (ADR-0467).

Исправлена найденная в CI гонка Workbench.close: owner shutdown теперь начинается после pre-close hooks и запуска teardown сессии. Реальный browser regression RED→GREEN, откат прежнего порядка возвращает RED (ADR-0468).

Гарантия: заявленный vitest run на точной паре; другие версии/режимы вне гарантии, без искусственных запретов. QuickJS Proxy-backed mirrors ограничены native cloning. Остальные VM/async Worker gaps сохранены отдельно.

Проверено на исходном commit 1179ddf:

  • независимый Final+GREEN: 214/214 coverage PASS, без findings/residuals;
  • pnpm pr:check: 25/25 PASS;
  • exact Vitest: 10 запусков, обе pools; native oracle и negative modes;
  • бинарные IPC-графы, getters/Proxy/errors и физическая IPC parity;
  • реальный close regression + неизменённый companion suite: 9/9 PASS; независимые unit: 165 PASS;
  • packed consumer с настоящими tarballs: PASS;
  • полный CI36139754267: PASS, включая production/browser/unit/parity/hosted/no-COI.

Эпик и 15 выполненных items закрыты. Доказательства и bound verdict: docs/backlog/runtime-js/reference/vitest-delivery-evidence.md, workbench-close-admission-evidence.md, vitest-delivery-final-green.json. Финальный head daf823b содержит только записи проверки. Ready-PR CI36143100599: 19/19 PASS; pass-binding OK; merge state CLEAN. Один PR, без merge.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

@vanilla-wave
vanilla-wave marked this pull request as ready for review September 25, 2026 12:11
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[High risk] Updates build configuration and test infrastructure for browser testing.

The PR is not yet safe to merge because bare package-name overrides still fail as substitutions.

Findings

  1. P1 Bare substitutions stop working ▶
  2. P2 Captured output buffers without limit ▶

Summary

The PR runs the specified Vitest/Vite pair in the browser shell and adds a causal admission signal so Workbench waits for project pre-close hooks before shutting down the owner. The latest changes also add native agent-history restoration and trace provenance.

Reviews (2) · Last reviewed commit: "Bind final delivery review after close a..."

Comment on lines +51 to +55
if (at <= 0) {
return requestedName && !target.startsWith('npm:')
? { name: requestedName, range: str }
: { name: str, range: null };
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Bare substitutions stop working
A user override that names a replacement package without a version, such as { "left-pad": "replacement-package" }, is now treated as a version range for left-pad. The installer searches for left-pad@replacement-package instead of applying the previously supported substitution, so the install fails.

Comment on lines +212 to +218
handle.stdout().on('data', (chunk) => {
this.stdout.push(chunk);
this.emitToOwner('stdout', chunk);
});
handle.stderr().on('data', (chunk) => {
this.stderr.push(chunk);
this.emitToOwner('stderr', chunk);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Captured output buffers without limit
With stdout: true or stderr: true, these listeners keep draining kernel output into the public Readables even when nobody consumes them. Because push() backpressure is ignored, sustained Worker output can accumulate without bound in browser memory.

@vanilla-wave
vanilla-wave marked this pull request as draft September 25, 2026 13:04
@vanilla-wave
vanilla-wave marked this pull request as ready for review September 25, 2026 13:46
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.

1 participant