Skip to content

Add agenteval-datasets, agenteval-reporting, and agenteval-junit5 modules (Phase 3)#4

Merged
pratyush618 merged 5 commits into
mainfrom
feat/phase3-junit5-datasets-reporting
Mar 12, 2026
Merged

Add agenteval-datasets, agenteval-reporting, and agenteval-junit5 modules (Phase 3)#4
pratyush618 merged 5 commits into
mainfrom
feat/phase3-junit5-datasets-reporting

Conversation

@pratyush618

Copy link
Copy Markdown
Collaborator

Summary

  • agenteval-datasets: JSON dataset loading with envelope/bare-array auto-detection, round-trip serialization via EvalDataset, JsonDatasetLoader, JsonDatasetWriter
  • agenteval-reporting: ConsoleReporter (ANSI-colored formatted table) and JunitXmlReporter (CI-compatible JUnit XML via javax.xml DOM)
  • agenteval-junit5: JUnit 5 extension with @AgentTest, @Metric, @DatasetSource annotations, MetricFactory (reflective instantiation), DatasetArgumentsProvider, and standalone fluent assertion API (AgentAssertions)

Completes the P0 MVP — all 7 modules are now implemented with 53 new tests across the 3 modules (15 + 10 + 28), all quality gates passing (Checkstyle, SpotBugs, -Werror).

Add agenteval-datasets, agenteval-reporting, and agenteval-junit5 module
POMs with dependency declarations. Update parent POM with new modules
and managed dependencies for agenteval-metrics, agenteval-datasets,
and agenteval-reporting.
Implement dataset loading infrastructure:
- EvalDataset: immutable builder with Jackson support and save(Path)
- DatasetLoader/DatasetWriter: pluggable format interfaces
- JsonDatasetLoader: auto-detects envelope vs bare array JSON formats
- JsonDatasetWriter: pretty-printed envelope format output
- DatasetException: unchecked exception for load/write errors

Includes 15 unit tests covering round-trip serialization, format
auto-detection, error handling, and defensive copying.
Implement evaluation result reporting:
- EvalReporter: interface for pluggable report formats
- ConsoleReporter: formatted table with ANSI colors, PrintStream
  injection for testability, pass/fail icons, per-metric averages
- JunitXmlReporter: standard JUnit XML via javax.xml DOM, compatible
  with Jenkins, GitHub Actions, and GitLab CI
- ReportException: unchecked exception for report generation errors

Includes 10 unit tests covering passing/failing results, ANSI toggle,
XML structure validation, and empty result handling.
Implement JUnit 5 integration for agent evaluation:
- @AgentTest: meta-annotation combining @test + @tag("eval") + @ExtendWith
- @Metric/@metrics: repeatable metric declaration with threshold
- @DatasetSource: parameterized test source from JSON dataset files
- AgentEvalExtension: ParameterResolver + InvocationInterceptor +
  AfterEachCallback for full test lifecycle integration
- MetricFactory: reflective metric instantiation probing 4 constructor
  signatures (JudgeModel+double, double, JudgeModel, no-arg)
- DatasetArgumentsProvider: loads AgentTestCase args from classpath JSON
- AgentAssertions/AgentTestCaseAssert: standalone fluent assertion API
  with meetsMetric, hasToolCalls, calledTool, outputContains, etc.

Includes 28 unit tests covering parameter resolution, metric evaluation,
dataset loading, factory instantiation, and assertion chain behavior.
Add exclusions for false positives in new modules:
- EvalDataset: fields use List.copyOf/Map.copyOf (EI_EXPOSE_REP)
- JsonDatasetLoader/Writer: ObjectMapper is thread-safe (EI_EXPOSE_REP2)
- ConsoleReporter: PrintStream stored for DI/testing (EI_EXPOSE_REP2)
- AgentTestCaseAssert: intentionally exposes mutable test case (EI_EXPOSE_REP)
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.

1 participant