Repository navigation
test: add coverage for v4 ingestion pipeline - #318
fizae47-arch wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
divyanshkulshrestha23
left a comment
There was a problem hiding this comment.
Ran the full suite locally (Windows, Python 3.12) and 5 tests in test_milvus_store.py fail: TestV4Schema (4) and TestV4IndexParams::test_builds_dense_and_sparse_indexes. They pass when the file runs alone, so it's test-order pollution, not Windows-specific (reproduced on Linux too):
pytest tests/test_milvus_store.py # 58 passed
pytest tests/test_flo_tracing.py tests/test_milvus_store.py # 5 failed
Cause: tests/test_flo_tracing.py:11 does sys.modules.setdefault("pymilvus", MagicMock()). It's collected before test_milvus_store.py, so the real pymilvus added to requirements-test.txt here never gets imported and the schema/index builders return MagicMocks.
Fix that works locally (full suite: 0 failures) is to only mock when pymilvus is missing, the same pattern #319 uses:
try:
import pymilvus # noqa: F401
except ImportError:
sys.modules["pymilvus"] = MagicMock()Happy to open a separate small PR for test_flo_tracing.py if you'd rather keep this one focused.
Also, related cleanup: three of the four skipped tests in tests/test_docs_pipeline.py look covered here now (legacy schema - test_rejects_existing_collection_with_incompatible_schema, chunk replacement - test_updates_existing_collection_by_deleting_old_document_chunks, embedding dimension - test_rejects_invalid_embedding_dimension). test_docs_cleaner_preserves_markdown_link_adjacent_yaml (line 138) doesn't seem to have an equivalent for the canonical ingest path. Can follow up on that once this lands.
Summary
Adds automated test coverage for the v4 ingestion pipeline as requested in #259.
Changes
test_hugo_ingest.pycovering YAML/TOML frontmatter parsing, BOM handling, malformed frontmatter, and HTML table conversion including rowspan/colspan.test_canonical_rag_ingest.pycovering canonical document metadata, section paths, chunking, release dates, and document types.test_milvus_store.pycovering schema/index definitions, embedding preparation, validation, and store safety checks.requirements-test.txt.Validation
Ran:
Result: 98 passed
Milvus store operations are tested with a fake client. Schema structure is checked using PyMilvus objects. No live Milvus server integration test was run.
Closes #259