Speed up E2E tests via globalSetup + selective embed#54
Merged
antoninbas merged 1 commit intomainfrom Apr 19, 2026
Merged
Conversation
Move corpus prep, BM25 indexing, and server subprocess spawn into vitest globalSetup so they run once per suite instead of once per test file. Embedding is still triggered lazily by tests that need it (search, filters, parity), memoized per-mode across files via isolate:false. CRUD tests skip embed entirely since they don't query the vector store. Cuts e2e wall time roughly in half. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
globalSetupso they run once per suite instead of once per test file.embed()per mode across files (isolate: false) so the embed model is loaded once per mode for the entire suite.embed()entirely for CRUD tests, which don't query the vector store.Local wall time drops from ~5+ min to ~2.7 min (160s for all 65 tests across 4 files).
Test plan
npx vitest run --config vitest.e2e.config.ts) — 65/65 passing in 160se2ejob🤖 Generated with Claude Code