Skip to content

Speed up E2E tests via globalSetup + selective embed#54

Merged
antoninbas merged 1 commit intomainfrom
e2e-optimize
Apr 19, 2026
Merged

Speed up E2E tests via globalSetup + selective embed#54
antoninbas merged 1 commit intomainfrom
e2e-optimize

Conversation

@antoninbas
Copy link
Copy Markdown
Owner

Summary

  • Hoist corpus prep, BM25 indexing, and server subprocess spawn into vitest globalSetup so they run once per suite instead of once per test file.
  • Memoize embed() per mode across files (isolate: false) so the embed model is loaded once per mode for the entire suite.
  • Skip 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

  • Run full E2E suite locally (npx vitest run --config vitest.e2e.config.ts) — 65/65 passing in 160s
  • CI green on e2e job

🤖 Generated with Claude Code

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>
@antoninbas antoninbas merged commit bb7237a into main Apr 19, 2026
7 checks passed
@antoninbas antoninbas deleted the e2e-optimize branch April 19, 2026 20:58
@antoninbas antoninbas mentioned this pull request Apr 19, 2026
1 task
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