Skip to content

feat: add JUnit XML output format for CI integration#93

Open
kai-agent-free wants to merge 1 commit into
guard0-ai:mainfrom
kai-agent-free:feat/junit-xml
Open

feat: add JUnit XML output format for CI integration#93
kai-agent-free wants to merge 1 commit into
guard0-ai:mainfrom
kai-agent-free:feat/junit-xml

Conversation

@kai-agent-free
Copy link
Copy Markdown

Closes #83

Changes

  • New file: src/reporters/junit.ts — JUnit XML reporter that converts scan findings to standard JUnit XML format
  • Updated: src/cli/commands/scan.ts — added --junit [file] CLI option with proper type annotation
  • New file: tests/unit/junit-reporter.test.ts — 7 unit tests covering all reporter functionality

Implementation Details

  • Findings grouped by domain into <testsuite> elements
  • Each finding becomes a <testcase>; critical/high/medium severity → <failure>
  • XML special characters properly escaped
  • Supports both stdout output (--junit) and file output (--junit report.xml)
  • Follows existing reporter patterns (sarif.ts, json.ts)

Testing

  • tsc --noEmit
  • All 7 new tests pass ✅
  • Full suite: 1565/1566 pass (1 pre-existing integration failure unrelated to this PR)

- Add src/reporters/junit.ts with JUnit XML reporter
- Add --junit [file] option to scan command
- Group findings by domain into testsuites
- Mark critical/high/medium findings as failures
- Add 7 unit tests for the reporter

Closes guard0-ai#83
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 JUnit XML output format for CI integration

1 participant