test: raise coverage gate to 97% and cover remaining branches - #21
Merged
Merged
Conversation
- Measure subprocess coverage (patch = subprocess) so the real-FAISS derive tests count toward index/derive.py - Add tests for lifecycle legacy/validation failures, trusted ingestion title/type/skip/failure paths and build_manifest, ollama_embed on_attempt reporting, and derive's defensive failure paths - Raise fail_under from 95 to 97 (now 99.87%) Co-Authored-By: Claude Opus 5.5 <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
fail_underin.coveragercgoes from 95 to 97.patch = subprocessto.coveragerc. Theindex/derive.pytests run in a separate process so they can use real FAISS, because other tests replacefaisswith a mock. Coverage wasn't measuring that process, soderive.pyshowed 0%.index/lifecycle.py: validation failures for old-format indexes, missing files, an index that won't load, wrong vector size, and sources recorded only as absolute paths.ingestion/trusted.py: title and document-type selection, which directories and files are skipped, unreadable/empty/missing sources, invalid visibility falling back toREVIEW_REQUIRED, andbuild_manifest.rag/engine.py: theon_attemptretry callback inollama_embed, on success and on failure.index/derive.py: one test per safety check (existing output, leftover.partialdirectory, source that won't load, invalid visibility that got past validation, and derived output that fails validation or has altered vectors or metadata). Each failure test also checks that nothing is left on disk.Test plan
pytest --cov: 475 passed, 99.87% coverage, above the 97% minimum.patch = subprocessneeds coverage 7.10 or newer, which pytest-cov 7.0.0 should pull in.🤖 Generated with Claude Code