[PR #1151] tools: compare JUnit runs with private aggregate triage (JUNIT-TRIAGE) #1183

Open
opened 2026-11-26 20:20:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1151
Author: @Taffyyy-ops
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: feat/junit-triage


📝 Commits (3)

  • e7aca7e tools: compare JUnit runs with private aggregate triage (JUNIT-TRIAGE)
  • f0297ae junit_triage: classify CTest status="disabled" as skipped
  • e8f649f junit_triage: reconfigure stdout encoding in main

📊 Changes

3 files changed (+231 additions, -0 deletions)

View changed files

➕ docs/junit_triage.md (+17 -0)
➕ tests/test_junit_triage.py (+99 -0)
➕ tools/junit_triage.py (+115 -0)

📄 Description

Adds tools/junit_triage.py (with documentation in docs/junit_triage.md and synthetic tests in tests/test_junit_triage.py) to compare two UTF-8 JUnit XML reports (before.xml and after.xml) and emit privacy-preserving aggregate transition counts without printing test names, file paths, failure messages, or captured logs.

Changes

  • Parser & safety checks (tools/junit_triage.py):
    • Supports testsuite and testsuites roots, enforces UTF-8 decoding, rejects DTD / entity declarations (<!DOCTYPE / <!ENTITY), caps report size at 32 MiB and 200,000 cases, rejects duplicate (classname, name) identities, and validates finite non-negative time attributes when present.
    • Classifies CTest status="disabled" (case-insensitive) as skipped (commit f0297ae42, per @kawaii-shakal review).
    • Reconfigures sys.stdout with errors="replace" in __main__ so redirected ANSI-code-page invocations do not raise UnicodeEncodeError.
  • CLI & documentation (docs/junit_triage.md): Summarizes matched, added, missing, regression, fixed, added-failure, skipped-to-failed, newly-skipped, resumed, and still-failed counts in plain text or --json (exit 0 when regressions == 0, 1 when regressions exist, 2 on invalid/unreadable reports).
  • Synthetic tests (tests/test_junit_triage.py): 6 unit tests covering transition counts, CTest status="disabled" transitions, duplicate/invalid/DTD/oversized inputs, 10,000-case synthetic runs, UTF-8 paths, and output privacy.

Verification

  • AI-assisted; synthetic inputs only, no game data or GPU required.
  • Ran python -I tests/test_junit_triage.py -v, python -I tests/test_tool_stdout_encoding.py -v, python -I tests/test_text_write_line_endings.py, tests/test_docs_*.py, python -I scripts/check_no_game_data.py, and git diff --check.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1151 **Author:** [@Taffyyy-ops](https://github.com/Taffyyy-ops) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/junit-triage` --- ### 📝 Commits (3) - [`e7aca7e`](https://github.com/ubiquitarianism/leonida/commit/e7aca7e293d616a92c53e6f6bc01ee1f51ee110b) tools: compare JUnit runs with private aggregate triage (JUNIT-TRIAGE) - [`f0297ae`](https://github.com/ubiquitarianism/leonida/commit/f0297ae42bbbc4e0b8a1f64005d41c9bf56be13b) junit_triage: classify CTest status="disabled" as skipped - [`e8f649f`](https://github.com/ubiquitarianism/leonida/commit/e8f649ffc7ac56f71df09f01149b1bfef952eca9) junit_triage: reconfigure stdout encoding in __main__ ### 📊 Changes **3 files changed** (+231 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/junit_triage.md` (+17 -0) ➕ `tests/test_junit_triage.py` (+99 -0) ➕ `tools/junit_triage.py` (+115 -0) </details> ### 📄 Description Adds `tools/junit_triage.py` (with documentation in `docs/junit_triage.md` and synthetic tests in `tests/test_junit_triage.py`) to compare two UTF-8 JUnit XML reports (`before.xml` and `after.xml`) and emit privacy-preserving aggregate transition counts without printing test names, file paths, failure messages, or captured logs. ### Changes - **Parser & safety checks (`tools/junit_triage.py`):** - Supports `testsuite` and `testsuites` roots, enforces UTF-8 decoding, rejects DTD / entity declarations (`<!DOCTYPE` / `<!ENTITY`), caps report size at 32 MiB and 200,000 cases, rejects duplicate `(classname, name)` identities, and validates finite non-negative `time` attributes when present. - Classifies CTest `status="disabled"` (case-insensitive) as `skipped` (commit `f0297ae42`, per `@kawaii-shakal` review). - Reconfigures `sys.stdout` with `errors="replace"` in `__main__` so redirected ANSI-code-page invocations do not raise `UnicodeEncodeError`. - **CLI & documentation (`docs/junit_triage.md`):** Summarizes matched, added, missing, regression, fixed, added-failure, skipped-to-failed, newly-skipped, resumed, and still-failed counts in plain text or `--json` (exit `0` when `regressions == 0`, `1` when regressions exist, `2` on invalid/unreadable reports). - **Synthetic tests (`tests/test_junit_triage.py`):** 6 unit tests covering transition counts, CTest `status="disabled"` transitions, duplicate/invalid/DTD/oversized inputs, 10,000-case synthetic runs, UTF-8 paths, and output privacy. ### Verification - AI-assisted; synthetic inputs only, no game data or GPU required. - Ran `python -I tests/test_junit_triage.py -v`, `python -I tests/test_tool_stdout_encoding.py -v`, `python -I tests/test_text_write_line_endings.py`, `tests/test_docs_*.py`, `python -I scripts/check_no_game_data.py`, and `git diff --check`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1183
No description provided.