Skip to content

feat(testing): add JUnit formatter for TestReport#1573

Open
diiviikk5 wants to merge 1 commit intomofa-org:mainfrom
diiviikk5:feat/testing-junit-formatter
Open

feat(testing): add JUnit formatter for TestReport#1573
diiviikk5 wants to merge 1 commit intomofa-org:mainfrom
diiviikk5:feat/testing-junit-formatter

Conversation

@diiviikk5
Copy link
Copy Markdown
Contributor

@diiviikk5 diiviikk5 commented Apr 3, 2026

Closes #1567
image

Summary

Add a deterministic JUnitFormatter to mofa-testing so TestReport can be exported as JUnit XML for CI systems and test-report consumers.

What Changed

  • added JUnitFormatter to the report layer
  • exported it through tests/src/report/mod.rs and tests/src/lib.rs
  • mapped TestReport into a single testsuite
  • mapped each TestCaseResult into a testcase
  • encoded failures with <failure>
  • encoded skipped tests with <skipped/>
  • included metadata as <properties> when present
  • escaped XML-sensitive content for stable output

Why

mofa-testing already had JSON and text output, and Markdown is being added separately, but there was still no native JUnit XML path for CI tooling. This PR fills that gap without changing the existing report model.

Testing

Ran:

cargo test -p mofa-testing --test report_tests

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.

feat(testing) Add JUnit Formatter for TestReport

1 participant