test(code-intel): fix 9 pre-existing SemanticSearchManager test failures#93
Merged
Conversation
test_semantic_search.py built managers via SemanticSearchManager.__new__() and hand-listed dataclass fields; new fields (scoring_config, _trigram_index, nl_mode) were never added to those blocks, so 9 tests crashed with AttributeError on the core retrieval path. Plus test_queue_reindex_noop_when_unavailable didn't stub _ensure_provider, so the real BGE provider loaded and flipped _keyword_fallback back to False, defeating its simulated-unavailable assertion. Route the 5 __new__ blocks through a shared _bare_manager() that uses the real (cheap, provider-deferred) constructor + targeted overrides, so adding future fields can't silently re-break these. Stub _ensure_provider in the noop test. integrations/context suite: 582p/9f -> 591p/0f. Co-Authored-By: Claude Opus 4.8 (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.
Why
test_semantic_search.pybuilt managers viaSemanticSearchManager.__new__()and hand-listed dataclass fields. When new fields were added (scoring_config,_trigram_index,nl_mode), those__new__blocks weren't updated, so 9 tests crashed withAttributeErroron the core retrieval path. Separately,test_queue_reindex_noop_when_unavailabledidn't stub_ensure_provider, so the real BGE provider loaded and flipped_keyword_fallbackback to False — defeating its own simulated-unavailable assertion.What changed
__new__blocks through a shared_bare_manager()that uses the real (cheap, provider-deferred) constructor + targeted overrides, so adding future fields can't silently re-break these._ensure_providerin the noop test.Tests
integrations/contextsuite: 582 passed / 9 failed → 591 passed / 0 failed. Test-only change; no production code touched.🤖 Generated with Claude Code