Skip to content

[Test]: cover RAG preparation and search helpers - #109

Merged
viiccwen merged 1 commit into
mainfrom
test/rag-search-helpers
Jul 13, 2026
Merged

[Test]: cover RAG preparation and search helpers#109
viiccwen merged 1 commit into
mainfrom
test/rag-search-helpers

Conversation

@viiccwen

Copy link
Copy Markdown
Contributor

Summary

Add deterministic unit coverage for RAG data loading, document preparation, BM25 search, hybrid ranking, and source hashing. Tests isolate module state and avoid embedding or FAISS initialization.

Related Issue

Fixes #86

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Configuration or deployment
  • Tests

Changes

  • Cover valid, missing, and malformed JSONL inputs plus valid and missing Markdown files using tmp_path.
  • Cover FAQ, paragraph, entity, and Markdown document preparation with deterministic keyword extraction.
  • Cover BM25 index construction and ranking plus hybrid ranking with in-memory documents and fake semantic results.
  • Cover source hashes for present and missing inputs and isolate loader caches and module-level BM25 state between tests.

Testing

  • Local tests or checks pass: make test (182 passed)
  • Manual verification completed: targeted RAG tests, make precommit, and git diff --check
  • Not tested; reason:

Impact Checklist

  • Discord bot behavior checked, if affected
  • MCP server behavior checked, if affected
  • Webhook behavior checked, if affected
  • Docker or compose changes checked, if affected
  • Environment variables documented, if changed
  • Logs do not expose secrets or sensitive data

Notes for Reviewers

This is a test-only change. It does not call initialize_rag_system(), instantiate embedding models, or build/load FAISS indexes. Existing dependency deprecation warnings are unchanged.

Signed-off-by: viiccwen <vicwen@apache.org>
@viiccwen
viiccwen marked this pull request as ready for review July 13, 2026 04:49
@viiccwen
viiccwen merged commit 4725072 into main Jul 13, 2026
2 checks passed
@viiccwen
viiccwen deleted the test/rag-search-helpers branch July 13, 2026 04:49
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.

[Feature]: Add unit tests for RAG data preparation and search helpers

1 participant