Repository navigation
Make semantic search tests independent of installed extras - #67
Closed
offbyonebit wants to merge 1 commit into
Closed
offbyonebit wants to merge 1 commit into
offbyonebit wants to merge 1 commit into
Conversation
test_semantic_search_requires_optional_dependency only passed when fastembed was absent. With the semantic extra installed it tried to download the BAAI embedding model, so it failed offline and depended on the network. Split it in two. The dependency test now hides fastembed itself, so the missing-extra error is checked in every environment. The full-flow test uses a deterministic fake embedder, like the neighbouring test, and checks that results are ranked by similarity.
This was referenced Oct 6, 2026
Merged
Owner
Author
|
Closing as superseded by merged PR #68 (48bc7e9), which is an ancestor of current main. Verified the original text patches against that merge and the four UI image blobs by Git blob SHA. The plugin annotation from #64 is present; its surrounding fallback also received a safer getattr check. No outstanding changes from these PRs remain. |
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
test_semantic_search_requires_optional_dependencyonly passed whenfastembedwas not installed. With thesemanticextra present it tried to download theBAAI/bge-small-en-v1.5model, so it failed offline (and any environment with the extra but no network) and could not pass in an all-extras run.Split into two deterministic tests:
test_semantic_search_requires_optional_dependencyhidesfastembeditself (patchesfind_spec), so the "requires the semantic extra" error is checked in every environment.test_semantic_search_indexes_and_ranks_with_embeddercovers the full index and search flow with a fake embedder, like the neighbouring test, and asserts results are ranked by similarity. It skips ifnumpyis missing.No product code changed.
Testing
fastembedconfirmed absent): 1129 passed, 1 skipped.fastembedpresent): 1129 passed, 1 skipped.Generated by Claude Code