Skip to content

Add JUnit XML comparison reports - #22

Merged
AdityaWagh06 merged 5 commits into
OpenWave-India:mainfrom
siddardh-core:feat/junit-report
Oct 30, 2026
Merged

AdityaWagh06 merged 5 commits into
OpenWave-India:mainfrom
siddardh-core:feat/junit-report

Conversation

@siddardh-core

Copy link
Copy Markdown
Contributor

Summary

  • Add JUnit XML output to the modeldiff compare command using --format junit.
  • Generate a JUnit-compatible XML test suite with testcase elements and failure, error, and skipped counts.
  • Escape XML content safely using Python's xml.etree.ElementTree.
  • Add unit and CLI integration tests for JUnit report generation and classification.

Failure and skipped-case handling

  • Regression: Report as a failure when the candidate case fails.
  • Still failing: Report as a failure when the candidate case remains in an error state.
  • Candidate execution error: Report as an error, except for still-failing cases, which remain failures.
  • Missing in candidate: Report as skipped because no candidate result is available.
  • Fixed and passing cases: Do not emit a failure, error, or skipped element.

Validation

  • python -m ruff check . — passed.
  • python -m pytest — 150 passed.
  • git diff --check — passed.

@AdityaWagh06 AdityaWagh06 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @siddardh-core, the renderer is well structured and the escaping test is a nice touch. A few things before this can be merged:

  1. Formatting fails CI. ruff format --check reports 3 files (report.py, test_cli.py, test_compare_and_report.py). Run ruff format src tests examples and commit the result.
  2. Behavior changes. The issue asks for cases that pass in both runs but whose output changed to be passing testcases with a <system-out> note (case.category == "unchanged_pass" and case.output_changed). Please add that, with a test.
  3. README. Add junit to the compare --format line in the CLI reference, plus one or two sentences on the mapping: regressions and still-failing cases → <failure>, errors → <error>, missing in candidate → <skipped>, behavior changes → pass with <system-out>.
  4. Unreachable branch. elif case.candidate_status is None can't be reached, because a missing candidate is always missing_in_candidate. Please remove it.
  5. Heads-up: another PR touching report.py was just merged. Please update your branch with main (git fetch upstream && git merge upstream/main) and resolve the conflict. Keep both the warnings section and your junit branch.

Once these are done and CI is green, I'll take another look.

@siddardh-core

Copy link
Copy Markdown
Contributor Author

Hi @AdityaWagh06,

I've addressed all the requested changes in my latest commit (4624158).

  • Added the <system-out> note for passing cases with changed output.
  • Updated the JUnit test.
  • Updated the README documentation.
  • Removed the unreachable branch.
  • Merged the latest upstream main and preserved the warnings functionality.

All local checks are passing:

  • Ruff formatting and lint: passed.
  • Pytest: 166 passed.
  • git diff --check: passed.

I noticed that GitHub is showing a workflow awaiting maintainer approval, so the CI checks are still pending.

Could you please approve the workflow and review the latest changes when convenient?

Thank you for your guidance!

@AdityaWagh06

Copy link
Copy Markdown
Member

Thanks @siddardh-core, all four points are addressed, nice work! Two small things left:

  1. Two more PRs were merged since your update, so there's now a conflict in tests/test_cli.py. Please merge main again and keep both sets of tests.
  2. In the README, remove the empty line you added inside the CLI code block (after the compare lines) and the empty bullet left in the Roadmap list where the JUnit line was.

Once CI is green, I'll merge it.

@siddardh-core

Copy link
Copy Markdown
Contributor Author

Hi! I've merged the latest upstream/main into my branch and resolved the conflict in tests/test_cli.py, preserving both the existing upstream tests and my JUnit export test.

I also verified the changes:

  • All 177 tests passed.
  • Ruff formatting and lint checks passed.
  • git diff --check passed.

I'm completing the requested README formatting cleanup next. I'll push that update once it's done. Thank you for the review and guidance!

@AdityaWagh06
AdityaWagh06 merged commit 641d040 into OpenWave-India:main Oct 30, 2026
12 checks passed
@AdityaWagh06

Copy link
Copy Markdown
Member

Merged, thank you @siddardh-core! JUnit output was on our roadmap, and you handled every review point carefully: errors vs failures, skipped missing cases, the changed-output note and escaping. Great work, and it’ll ship in v0.2.0 next week 🎉

If you enjoyed contributing, a ⭐ on the repo helps others find the project. Follow OpenWave India on GitHub and LinkedIn for new projects coming soon.

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