Skip to content

feat(cli): JUnit + JSON reporters for run-all (CI integration)#16

Merged
GamalAnwar merged 1 commit into
masterfrom
claude/cli-reporters
Jun 18, 2026
Merged

feat(cli): JUnit + JSON reporters for run-all (CI integration)#16
GamalAnwar merged 1 commit into
masterfrom
claude/cli-reporters

Conversation

@GamalAnwar

Copy link
Copy Markdown
Contributor

Summary

Adds CI-friendly reporters to forge run-all, so teams running collections in pipelines get the same machine-readable outputs they get today from bru run --reporter-junit/--reporter-json — removing a switching cost for Bruno/Newman users.

forge run-all ./collection \
  --reporter-junit report.xml \
  --reporter-json  report.json
  • JUnit XML: each .http file becomes a <testsuite> and each request a <testcase>. Transport errors map to <error>; failed assertions and post-response test()s map to <failure> with the subject op expected (got actual) detail. Names/values are XML-escaped. Consumable by GitHub Actions, GitLab, Jenkins, etc.
  • JSON: a { summary: { total, passed, failed }, suites: [...] } document carrying the full, already-serde-serializable run results.

Design

Report generation is a pure, unit-tested forge_engine::report module (junit_xml / json_report over ReportSuite groups) — the CLI just accumulates runs per file and writes the requested formats. This keeps the logic in the well-tested engine layer rather than the binary.

Testing

  • Unit tests for both formats (counts, <failure>/<error> shapes, XML escaping, empty input).
  • CLI integration tests asserting the written report.xml/report.json contents and that nothing is written when no reporter flag is passed.
  • report.rs at ~99% line coverage; workspace stays above the 95% gate.

🤖 Generated with Claude Code


Generated by Claude Code

`forge run-all` can now emit machine-readable reports for CI, matching the
pipeline outputs teams get from `bru run --reporter-junit/--reporter-json`:

  forge run-all ./collection \
    --reporter-junit report.xml \
    --reporter-json report.json

Each `.http` file becomes a JUnit `<testsuite>` and each request a
`<testcase>`; transport errors map to `<error>`, failed assertions and
post-response `test()`s to `<failure>` (with the subject/op/expected/actual
detail). The JSON report carries a pass/fail summary plus the full,
already-serializable run results.

The report generation lives in a pure, unit-tested `forge_engine::report`
module (`junit_xml` / `json_report` over `ReportSuite` groups); the CLI
just accumulates runs per file and writes the requested formats.

https://claude.ai/code/session_016jgMTwiYCiZA8F9JMFGfWR
@GamalAnwar GamalAnwar merged commit 9a6af35 into master Jun 18, 2026
2 checks passed
@GamalAnwar GamalAnwar deleted the claude/cli-reporters branch June 18, 2026 07:34
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
`forge run-all` can now emit machine-readable reports for CI, matching the
pipeline outputs teams get from `bru run --reporter-junit/--reporter-json`:

  forge run-all ./collection \
    --reporter-junit report.xml \
    --reporter-json report.json

Each `.http` file becomes a JUnit `<testsuite>` and each request a
`<testcase>`; transport errors map to `<error>`, failed assertions and
post-response `test()`s to `<failure>` (with the subject/op/expected/actual
detail). The JSON report carries a pass/fail summary plus the full,
already-serializable run results.

The report generation lives in a pure, unit-tested `forge_engine::report`
module (`junit_xml` / `json_report` over `ReportSuite` groups); the CLI
just accumulates runs per file and writes the requested formats.
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
`forge run-all` can now emit machine-readable reports for CI, matching the
pipeline outputs teams get from `bru run --reporter-junit/--reporter-json`:

  forge run-all ./collection \
    --reporter-junit report.xml \
    --reporter-json report.json

Each `.http` file becomes a JUnit `<testsuite>` and each request a
`<testcase>`; transport errors map to `<error>`, failed assertions and
post-response `test()`s to `<failure>` (with the subject/op/expected/actual
detail). The JSON report carries a pass/fail summary plus the full,
already-serializable run results.

The report generation lives in a pure, unit-tested `forge_engine::report`
module (`junit_xml` / `json_report` over `ReportSuite` groups); the CLI
just accumulates runs per file and writes the requested formats.
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
`forge run-all` can now emit machine-readable reports for CI, matching the
pipeline outputs teams get from `bru run --reporter-junit/--reporter-json`:

  forge run-all ./collection \
    --reporter-junit report.xml \
    --reporter-json report.json

Each `.http` file becomes a JUnit `<testsuite>` and each request a
`<testcase>`; transport errors map to `<error>`, failed assertions and
post-response `test()`s to `<failure>` (with the subject/op/expected/actual
detail). The JSON report carries a pass/fail summary plus the full,
already-serializable run results.

The report generation lives in a pure, unit-tested `forge_engine::report`
module (`junit_xml` / `json_report` over `ReportSuite` groups); the CLI
just accumulates runs per file and writes the requested formats.
GamalAnwar added a commit that referenced this pull request Jun 18, 2026
`forge run-all` can now emit machine-readable reports for CI, matching the
pipeline outputs teams get from `bru run --reporter-junit/--reporter-json`:

  forge run-all ./collection \
    --reporter-junit report.xml \
    --reporter-json report.json

Each `.http` file becomes a JUnit `<testsuite>` and each request a
`<testcase>`; transport errors map to `<error>`, failed assertions and
post-response `test()`s to `<failure>` (with the subject/op/expected/actual
detail). The JSON report carries a pass/fail summary plus the full,
already-serializable run results.

The report generation lives in a pure, unit-tested `forge_engine::report`
module (`junit_xml` / `json_report` over `ReportSuite` groups); the CLI
just accumulates runs per file and writes the requested formats.
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