diff --git a/README.md b/README.md index 899def1..995b2b5 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,15 @@ poetry run python3 -m pytest tests/integration/ -v Latest verification (2025-10-24): 144 passed, 10 skipped, 32 warnings. Warnings originate from third-party dependencies (`langchain` pydantic shim deprecations and `datetime.utcnow` usage). Track upstream fixes or pin patched releases as needed. ### Running CI Checks Locally +#### Usage + +Run all checks (same as CI): + +```bash +poetry run ruff check . +poetry run ruff format --check . +poetry run pytest tests -v +``` Before opening a pull request, you can run the same checks locally that are executed in CI. diff --git a/report.md b/report.md new file mode 100644 index 0000000..be9d1d6 --- /dev/null +++ b/report.md @@ -0,0 +1,8 @@ +# AgentUnit Report + +## emoji-suite +Success rate: 50.00% + +- **test_pass**: ✅ +- **test_fail**: ❌ + - Error: AssertionError diff --git a/src/agentunit/__init__.py b/src/agentunit/__init__.py index 797b897..3c874d1 100644 --- a/src/agentunit/__init__.py +++ b/src/agentunit/__init__.py @@ -1,5 +1,3 @@ -"""AgentUnit - pytest-style evaluation harness for agentic AI and RAG workflows.""" - from __future__ import annotations from .core.runner import Runner, run_suite @@ -8,6 +6,8 @@ from .reporting.results import ScenarioResult, SuiteResult +"""AgentUnit - pytest-style evaluation harness for agentic AI and RAG workflows.""" + __all__ = [ "DatasetCase", "DatasetSource", diff --git a/tests/test_reporting.py b/tests/test_reporting.py new file mode 100644 index 0000000..03aec87 --- /dev/null +++ b/tests/test_reporting.py @@ -0,0 +1,51 @@ +from datetime import datetime +from pathlib import Path + +from agentunit.reporting.results import ( + ScenarioResult, + ScenarioRun, + SuiteResult, +) + + +def test_markdown_contains_emojis(): + passing_run = ScenarioRun( + scenario_name="emoji-suite", + case_id="test_pass", + success=True, + metrics={}, + duration_ms=5, + trace=[], + error=None, + ) + + failing_run = ScenarioRun( + scenario_name="emoji-suite", + case_id="test_fail", + success=False, + metrics={}, + duration_ms=6, + trace=[], + error="AssertionError", + ) + + scenario = ScenarioResult( + name="emoji-suite", + runs=[passing_run, failing_run], + ) + + suite = SuiteResult( + scenarios=[scenario], + started_at=datetime.now(), + finished_at=datetime.now(), + ) + + output_path = Path("report.md") + suite.to_markdown(output_path) + # UTF-8 safety check (important for Windows) + markdown = output_path.read_text(encoding="utf-8") + + assert "✅" in markdown + assert "❌" in markdown + + markdown.encode("utf-8")