Skip to content

test(knowledge_base): add missing branch coverage for FAISSRetriever and KnowledgeBase#2433

Open
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:test/knowledge-base-missing-coverage
Open

test(knowledge_base): add missing branch coverage for FAISSRetriever and KnowledgeBase#2433
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:test/knowledge-base-missing-coverage

Conversation

@Wanbogang
Copy link
Collaborator

FAISSRetriever — 7 new tests:

  • None return from faiss.read_index
  • Dict metadata with qa_pair format
  • Dict metadata with invalid keys
  • Unsupported metadata type
  • search/batch_search with None index
  • batch_search out-of-bounds indices

KnowledgeBase — 1 new test:

  • format_context uses answer field for qa_pair docs

…wledgeBase

- FAISSRetriever: cover None index from faiss.read_index, dict metadata
  with qa_pair format, dict metadata with invalid keys, unsupported
  metadata type, search/batch_search with None index, and
  batch_search out-of-bounds index handling
- KnowledgeBase: cover format_context qa_pair branch that returns
  answer instead of text
@Wanbogang Wanbogang requested a review from a team as a code owner February 28, 2026 13:18
@github-actions github-actions bot added python Python code tests Test files labels Feb 28, 2026
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant