refactor: split monolithic integration test into 7 focused files#85
Merged
refactor: split monolithic integration test into 7 focused files#85
Conversation
The 1285-line rag-server.integration.test.ts was hard to navigate and maintain. Split it by domain into smaller, self-contained files while preserving all 38 tests and their independent setup/teardown. - protocol: AC-001 MCP protocol + AC-005 basic error handling (5 tests) - embedding: AC-003 vector embedding generation (5 tests) - search: AC-004 vector search (5 tests) - files: AC-006 format support + AC-007 file management (9 tests) - ingest: AC-008 re-ingestion + AC-009 error handling (4 tests) - delete: AC-010 file deletion (4 tests) - metadata: file title extraction + meta JSON sidecar (6 tests) No test logic changes. All 509 tests pass, check:all green. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The network monitor captured fetch calls from other test files running in the same process (isolate: false). Fix by snapshotting request count before test operations and filtering model download URLs per the AC. Co-Authored-By: Claude Opus 4.6 (1M context) <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
rag-server.integration.test.ts(1285 lines, 14 describe blocks) into 7 domain-focused test filesbeforeAll/afterAllsetup and teardownNew file structure
rag-server.protocol.integration.test.tsrag-server.embedding.integration.test.tsrag-server.search.integration.test.tsrag-server.files.integration.test.tsrag-server.ingest.integration.test.tsrag-server.delete.integration.test.tsrag-server.metadata.integration.test.tsWhy this split is safe
vi.mockusage in any file (compatible withisolate: false)RAGServerinstances — no cross-section state dependenciesTest plan
pnpm run check:allpasses (509 tests, lint, format, build, unused exports, circular deps)🤖 Generated with Claude Code