Skip to content

test: align corpus_search/rag tests with tests/README taxonomy#96

Merged
javier-alvarez merged 5 commits into
javi/markitdownfrom
tests/markitdown
Apr 30, 2026
Merged

test: align corpus_search/rag tests with tests/README taxonomy#96
javier-alvarez merged 5 commits into
javi/markitdownfrom
tests/markitdown

Conversation

@miguelgfierro
Copy link
Copy Markdown
Contributor

Summary

Reorganize the corpus_search / rag tests to follow the tests/README taxonomy and the rule that tests/unit/<module> mirrors src/fireflyframework_agentic/<module>.

Changes (5 commits)

  1. test(rag) — distribute the 11 files in tests/unit/corpus_search/ under tests/unit/rag/ (root + retrieval/ + ingest/), mirroring the source layout. git mv preserves history.
  2. test — align tests/ tree with the canonical module layout: move tests/rag/ingest/test_ledger.py and tests/content/loaders/* into tests/unit/<module>/; drop the empty tests/unit/ingestion/ (no matching source module).
  3. test — reclassify by purpose:
    • Move test_ingest_with_real_vectorstore.py and the benchmark smoke into tests/integration/ (multi-component, real DB shape).
    • Move test_cli.py, test_query_path.py, test_answerer.py into tests/examples/corpus_search/ (they exercise example code, not framework).
  4. test — apply @pytest.mark.nightly to slow integration tests; convert the file-level pytestmark in test_e2e_real_llm.py to per-function markers as the README requires.
  5. test — move example-importing tests out of tests/integration/. Now tests/integration/ only imports fireflyframework_agentic.*; anything that imports examples.* lives under tests/examples/corpus_search/.

Final shape

  • tests/unit/: one folder per src module (agents, content, rag, …); unit/rag/ contains framework-only tests for corpus, retrieval/, ingest/.
  • tests/integration/: framework-only multi-component tests (test_full_integration.py, test_ingest_with_real_vectorstore.py).
  • tests/examples/corpus_search/: anything that touches example code (test_agent, test_cli, test_query_path, test_answerer, test_benchmark_smoke, test_e2e_real_llm).

Test plan

  • pytest --collect-only succeeds on the new tree.
  • PR-gate (pytest -m "not nightly") green.
  • Nightly bucket (pytest -m nightly) still picks up the marked tests.

Move the 11 tests from tests/unit/corpus_search/ into the rag tree to
mirror the source layout under src/fireflyframework_agentic/rag/:

- corpus, query_path, cli, benchmark_smoke → tests/unit/rag/
- expander, hybrid, reranker, answerer     → tests/unit/rag/retrieval/
- pipeline, retry, ingest_with_real_vector → tests/unit/rag/ingest/

Drop the now-empty tests/unit/corpus_search/ package and update the
benchmark README path reference.
Move stray tests under tests/unit/ to mirror src/fireflyframework_agentic
modules:

- tests/rag/ingest/test_ledger.py → tests/unit/rag/ingest/.
- tests/content/loaders/{test_markitdown.py,fixtures/} → tests/unit/content/loaders/.
- Drop tests/unit/ingestion/ (no matching source module).

Top-level tests/ now contains only the canonical categories
(unit, integration, functional, security, performance,
data_validation, responsible_ai, examples).
Per tests/README purpose-based taxonomy:

- test_ingest_with_real_vectorstore.py → integration/ (drives real
  SqliteVecVectorStore + loader + chunker + ledger + ingest_one;
  docstring already labels it 'Integration test').
- test_benchmark_smoke.py → integration/ (multi-component end-to-end
  smoke of the ingest+retrieval pipeline; not a pytest-benchmark, so
  it does not belong in performance/).
- test_cli.py, test_query_path.py, test_answerer.py → examples/corpus_search/
  (these import from examples.corpus_search.* and exercise the example
  agent's CLI / facade / answerer, not the framework rag/ module).

unit/rag/ is now framework-only: corpus, retrieval (expander, hybrid,
reranker), and ingest (ledger, pipeline, retry).
- test_benchmark_smoke.py: mark the end-to-end mechanics-mode benchmark
  as nightly (the corpus/queries sync check stays in PR-gate).
- test_ingest_with_real_vectorstore.py: mark as nightly — drives real
  SqliteVecVectorStore + MarkitdownLoader (heavy deps).
- test_e2e_real_llm.py: move pytestmark file-level marker onto the
  function per tests/README convention ('functions or classes only,
  never via pytestmark at file level').
Per the rule that tests under tests/integration/ may only import the
framework, relocate to tests/examples/corpus_search/:

- test_e2e_real_llm.py — imports examples.corpus_search.agent.
- test_benchmark_smoke.py — imports tests.examples.corpus_search.benchmark.runner.

tests/integration/ now contains only framework-only integration tests
(test_full_integration.py, test_ingest_with_real_vectorstore.py).
@javier-alvarez javier-alvarez merged commit dd6602b into javi/markitdown Apr 30, 2026
@ancongui ancongui deleted the tests/markitdown branch May 31, 2026 00:44
ancongui pushed a commit that referenced this pull request May 31, 2026
test: align corpus_search/rag tests with tests/README taxonomy
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.

2 participants