Skip to content

test(integration): add full-pipeline e2e test with mock providers and all report formats#171

Merged
himanshu231204 merged 1 commit into
OpenAgentHQ:mainfrom
Nitjsefnie:test/106-pipeline-integration
Jul 17, 2026
Merged

test(integration): add full-pipeline e2e test with mock providers and all report formats#171
himanshu231204 merged 1 commit into
OpenAgentHQ:mainfrom
Nitjsefnie:test/106-pipeline-integration

Conversation

@Nitjsefnie

Copy link
Copy Markdown
Contributor

Fixes #106.

Adds tests/integration/test_pipeline/test_full_pipeline_reports.py — an end-to-end integration test of the full evaluation pipeline, covering the two aspects #106 asks for that the existing test_mock_e2e.py doesn't already exercise: loading the dataset from a JSON file and rendering all four report formats.

Two tests:

  1. test_full_pipeline_generates_all_report_formats — writes a 2-item dataset to a JSON file, loads it via JSONDatasetLoader, runs Engine with provider="mock" (the repo's own MockLLMProvider + MockRetriever), then renders the resulting EvaluationReport through TerminalReport, MarkdownReport, HTMLReport, and JSONReport, asserting each contains the expected summary/metrics/answer data.
  2. test_mock_providers_are_actually_invoked — spy subclasses of the repo mocks assert the LLM was called exactly once per item with the question-derived prompt, and the retriever once per item.

The tests are deliberately hard to pass vacuously — a silent fallback away from the mock path fails them three independent ways: the metric values (exact_match == 1.0 only because the mock echoes ground truth), unique sentinel strings that must reappear verbatim in the md/html/json renders, and the spy call counts. Verified by mutation: making MockLLMProvider.generate stop echoing ground truth fails both tests; restoring it passes both.

Purely additive — no production code touched. uv run pytest tests/integration/test_pipeline/test_full_pipeline_reports.py → 2 passed; ruff check clean on the new file. (Full-suite baseline note: under plain uv sync a number of pre-existing failures come from optional-dependency extras not being installed — unrelated to and unchanged by this diff.)

Disclosure: this contribution was made with AI assistance (Claude), with the work reviewed and verified by a human-directed process before submission.

Load a small sample dataset from a JSON file, run it through the Engine
with the mock LLM and mock retriever, and render the report in every
format (terminal, markdown, HTML, JSON), asserting the mocks were
actually exercised via recorded calls and sentinel answers.

Closes OpenAgentHQ#106

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@himanshu231204
himanshu231204 merged commit 0d2f1f6 into OpenAgentHQ:main Jul 17, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Congratulations @Nitjsefnie!

Your pull request has been successfully merged into main. 🚀

Thank you for contributing to OpenAgentHQ and helping improve the project.

We truly appreciate your contribution and hope to see you back with more amazing PRs!

Happy Open Sourcing! ❤️

🌟 This is your first merged contribution to this repository.
Welcome to the OpenAgentHQ contributors family!

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.

Add integration test for full evaluation pipeline with mock provider

2 participants