Skip to content

test(code-intel): fix 9 pre-existing SemanticSearchManager test failures#93

Merged
eren23 merged 1 commit into
mainfrom
fix/semantic-search-test-helpers
May 30, 2026
Merged

test(code-intel): fix 9 pre-existing SemanticSearchManager test failures#93
eren23 merged 1 commit into
mainfrom
fix/semantic-search-test-helpers

Conversation

@eren23

@eren23 eren23 commented May 30, 2026

Copy link
Copy Markdown
Owner

Why

test_semantic_search.py built managers via SemanticSearchManager.__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 with AttributeError on the core retrieval path. Separately, 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 own simulated-unavailable assertion.

What changed

  • 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.

Tests

integrations/context suite: 582 passed / 9 failed → 591 passed / 0 failed. Test-only change; no production code touched.

🤖 Generated with Claude Code

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>
@eren23 eren23 merged commit 2b3c276 into main May 30, 2026
3 checks passed
@eren23 eren23 deleted the fix/semantic-search-test-helpers branch May 30, 2026 18:18
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