Repository navigation
[CI] Reduce repeated persistence imports in UI-state tests - #26185
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe test store helper now returns the initially imported store factory on its first call in each test. On later calls, it resets modules and uses the existing SQLite-backed store setup. A per-test flag tracks store creation and resets before each test. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change is limited to test-store setup, and the configured runner keeps these cases sequential. No material mergeability risk is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
ELI5
The UI-state database tests now create their first real database instance through the existing fixture factory, avoiding repeated loading of the persistence modules. Tests that reopen the database still reload those modules exactly as before.
What Changed
Only the first
createStore()call in each case reuses the existing canonical constructor. It still installs that case's encryption provider before creating a fresh real SQLite database and authority in its fresh directory. Later calls keep the original module reset and dynamic import sequence. Every original assertion and cleanup body remains unchanged; the per-case flag resets inbeforeEach.Why
Each store instance and database needs fresh state; loading the same constructor again is unnecessary for the first instance in these UI tests. This keeps security/restart coverage and real Node database contracts, with a smaller change than replacing persistence with mocks or removing all module resets.
Linked Issue
Maintainer performance work; no new issue.
Visual Proof
N/A — test fixture only; no application behavior or UI change.
Testing
Three matched pairs, 41 unchanged original cases in one physical file, macOS arm64, Bun1.4.2 coordinator with actual Node24.20.0 database workers, Vitest5.0.3, four workers, Vitest filesystem module cache disabled. Each time includes the whole
pnpm testprocess through normal close. Same six ordered setups, isolation, assertions, case/status identities and protected actual-Node routing. Source frozen at5b0d38749de6ef942642d94a0f2e2f6d878dfb80.1.44× for this suite. All qualified samples, including the slower third control, are retained. One after pair 2 attempt (4.219451s) passed every correctness/config/source gate but overlapped external coordinators; raw logs/reports retained and only that noise failure retried. One subsequent preflight rejected a coordinator before launching any test. No signals were sent and no qualified sample was discarded. This is not a full-suite 2× result.
d85f70ea. The tested merge source isb7ac5d9d(incoming main520033b0plus this head). Canonical discovery and all five shard assignments enroll all 11,677 physical files exactly once: 11,538 pass and 139 existing skips; 112,605 passing cases, one expected failure and 1,049 existing skipped cases, zero unhandled errors. All 11,669 files from the prior PR source remain, with eight incoming-main additions and no removals. Routing remains 10,551 Bun files, 1,125 actual Node runtime files and one actual Node measurement file. The changed Node database suite passes all 41 cases. Full CI artifacts prove file enrollment and raw case counts; the focused qualifications above separately prove complete named-case parity.Review
Independent source review confirmed fresh constructor/authority/registration, per-case data-path overwrite, realm encryption-provider lookup, unchanged second/subsequent cold reloads and exact original case/cleanup bodies. Final head has green applicable checks and a clean merge state. Zero review threads were observed; this does not claim a review bot completed coverage. Self and independent source/evidence reviews are complete.
Agent skill upstream boundary
Notes
No production change, runtime migration, platform path change, deadline change, fixture mock replacement, test exclusion or weakened reload/security assertion. Remote SSH and folder fixtures retain their existing coverage.
Checklist