You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(test): keep persisted session fixtures independent of Vitest - #42543
Let Playwright prepare persisted chat records without loading Vitest's test hooks.
Files
Added
Deleted
Net
Test
46
$\color{#1a7f37}{\Huge{\mathbf{+}}}$78
$\color{#cf222e}{\Huge{\mathbf{−}}}$96
$\color{#cf222e}{\Huge{\mathbf{−}}}$18
Prod
10
$\color{#1a7f37}{\Huge{\mathbf{+}}}$205
$\color{#cf222e}{\Huge{\mathbf{−}}}$210
$\color{#cf222e}{\Huge{\mathbf{−}}}$5
What Changed
Playwright discovery for wsl-move-moved-project-chats.spec.ts currently crashes when its store-seeding import loads Vitest. All four general E2E shards in #42528 stop before running tests; the same single-spec discovery failure reproduces on pristine main.
Move ten persisted-store fixture declarations into their concrete persistence fixture owner. Update all 54 consumers to import definitions directly, without forwarding exports or wrappers.
Keep asynchronous worker setup, shared test-store caches and their cleanup in the existing Vitest harness. The raw persistence fixture opens and closes its own connection in finally.
Remove the Playwright spec's dependency on cleanup for caches that its seeding code never opens.
Remove two empty CLI suite declarations that Vitest rejects. Preserve both actual CLI cases and all existing assertions.
Why
The same persisted-record fixtures serve unit tests and Playwright. Their defining owner can remain independent of either runner; worker-owning fixtures retain the hooks that manage their resources.
Linked Issue
Prerequisite CI repair for #42528; no separate issue.
Visual Proof
N/A — test fixture ownership and discovery; no application visual or interaction change.
Testing
Matched background discovery on the branch and pristine main: same Vitest import error before this fix.
Repaired discovery for all 91 general specs from the failed CI selection: zero errors, 149 registrations; no test bodies executed.
Owning tests: all 162 assertions across 45 files passed. Two empty suite errors reproduced on pristine main; after removing the empty groups, both actual CLI cases pass.
Full TypeScript checking, scoped lint and formatting: passed on macOS.
Independent source, cleanup, binding, oracle and actual-commit audits: passed. No actual cases or assertions retired; no tests added.
Final ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=4: all 27 checks passed in 185.7 seconds, including related unit selection, immediately before push. Hosted checks required before merge.
Risk
Level: Low. Incorrect fixture ownership could omit worker cleanup or prevent tests from loading. The asynchronous harness retains its lifecycle; extracted SQL bodies and all registered test callbacks remain unchanged. This changes test support only. A plain revert restores the previous fixture dependency.
Review
Independent reviews cover direct-owner bindings, complete declaration bodies, eager module order, runner-neutral closure, database ownership and cleanup, unchanged test oracles, and the exact deletion of two empty groups. Detailed evidence stays local.
Agent skill upstream boundary
Not applicable: no upstream skill-installer material is copied or translated.
Notes
After this prerequisite merges, #42528 will rebase onto the actual main result and undergo fresh validation. The folder cleanup tracker remains local.
Checklist
Focused on the reproduced discovery failure and empty-suite gate failure
Explained the change and risk
Visual proof marked N/A
Source, resource lifecycle and test-oracle reviews complete
No actionable comments were generated in the recent review.
Walkthrough
A new persistence test fixture contains agent-session database seeding, reading, and editing helpers. The record-store test harness removes these helpers, and test consumers update their imports. Test assertions and behavior are otherwise unchanged, except for the removal of two empty subprocess suites and a journal-database close call.
Merge Risk: Minimal · up to afee9
This is a test-only refactor that moves persistence fixtures out of the Vitest harness so Playwright discovery no longer depends on it. It has no production impact, and no actionable merge-blocking risk remains. Hosted checks should still pass before merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(test): keep persisted session fixtures independent of Vitest" matches the main change. The PR moves persisted-store fixture declarations into a persistence fixture module that does not …
Description check
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof (marked N/A with a reason), Testing, Risk (Low, with a revert path), Agent skill upstre…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(test): keep persisted session fixtures independent of Vitest" matches the main change. The PR moves persisted-store fixture declarations into a persistence fixture module that does not depend on Vitest, and updates consumers to import them directly. The title is specific and concise, and it names the primary purpose of the change.
Full details: Description check
Explanation
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof (marked N/A with a reason), Testing, Risk (Low, with a revert path), Agent skill upstream boundary, Notes, and Checklist. The Linked Issue section says there is no separate issue and refers to prerequisite CI repair for #42528. The template asks for an issue link for outside contributors. The author's Testing section lists results but not the template's manual-test checkbox state. The AI Disclosure section is blank, which the template allows for internal contributors. These gaps are minor.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Let Playwright prepare persisted chat records without loading Vitest's test hooks.
What Changed
Playwright discovery for
wsl-move-moved-project-chats.spec.tscurrently crashes when its store-seeding import loads Vitest. All four general E2E shards in #42528 stop before running tests; the same single-spec discovery failure reproduces on pristine main.finally.Why
The same persisted-record fixtures serve unit tests and Playwright. Their defining owner can remain independent of either runner; worker-owning fixtures retain the hooks that manage their resources.
Linked Issue
Prerequisite CI repair for #42528; no separate issue.
Visual Proof
N/A — test fixture ownership and discovery; no application visual or interaction change.
Testing
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=4: all 27 checks passed in 185.7 seconds, including related unit selection, immediately before push. Hosted checks required before merge.Risk
Level: Low. Incorrect fixture ownership could omit worker cleanup or prevent tests from loading. The asynchronous harness retains its lifecycle; extracted SQL bodies and all registered test callbacks remain unchanged. This changes test support only. A plain revert restores the previous fixture dependency.
Review
Independent reviews cover direct-owner bindings, complete declaration bodies, eager module order, runner-neutral closure, database ownership and cleanup, unchanged test oracles, and the exact deletion of two empty groups. Detailed evidence stays local.
Agent skill upstream boundary
Notes
After this prerequisite merges, #42528 will rebase onto the actual main result and undergo fresh validation. The folder cleanup tracker remains local.
Checklist