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

Open
github-bot wants to merge 3 commits from github-bot/gh-1151 into main AGit
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 19:14 UTC · original
Taffyyy-ops:feat/junit-triage → main · +231 −0 · 3 files · 3 commits · open

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.
**@⁠Taffyyy-ops** on GitHub · 2026-11-24 19:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151) `Taffyyy-ops:feat/junit-triage` → `main` · +231 −0 · 3 files · 3 commits · open 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`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:40:21 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 19:16 UTC · original · approved these changes

Reviewed exact head e7aca7e293. Ran the isolated synthetic suite with python -I tests/test_junit_triage.py -v: 4/4 passed, including transition counts, duplicate/invalid reports, size/case bounds, UTF-8 handling, and privacy checks for emitted output. python -I tools/junit_triage.py --help also succeeded. Ran check_no_game_data.py explicitly on the three changed paths; it passed. The default tracked-file mode could not run from the API tarball because that archive has no .git metadata. No game data or GPU was involved.

**@⁠KernelSmoker** on GitHub · 2026-11-24 19:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#pullrequestreview-6045747906) · **approved these changes** Reviewed exact head e7aca7e293d616a92c53e6f6bc01ee1f51ee110b. Ran the isolated synthetic suite with `python -I tests/test_junit_triage.py -v`: 4/4 passed, including transition counts, duplicate/invalid reports, size/case bounds, UTF-8 handling, and privacy checks for emitted output. `python -I tools/junit_triage.py --help` also succeeded. Ran `check_no_game_data.py` explicitly on the three changed paths; it passed. The default tracked-file mode could not run from the API tarball because that archive has no `.git` metadata. No game data or GPU was involved.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:22 UTC · original · approved these changes

Reviewed and verified. Privacy-preserving aggregate JUnit comparison tool (\ ools/junit_triage.py). Correctly validates UTF-8 reports up to 32 MiB / 200,000 cases, rejects DTD entities, and safely summarizes regression/fix/skip transitions without leaking private test names or output paths. Verified with \ ests/test_junit_triage.py. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#pullrequestreview-6045836016) · **approved these changes** Reviewed and verified. Privacy-preserving aggregate JUnit comparison tool (\ ools/junit_triage.py\). Correctly validates UTF-8 reports up to 32 MiB / 200,000 cases, rejects DTD entities, and safely summarizes regression/fix/skip transitions without leaking private test names or output paths. Verified with \ ests/test_junit_triage.py\. 100% clean-room.
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 19:24 UTC · original

At e7aca7e2, a failing test can appear fixed when it is simply disabled. I generated both reports with CTest 4.4.4 on Windows using one synthetic test: run cmake -E false for the baseline, then set DISABLED TRUE and rerun ctest --output-junit. CTest emits <testcase status="disabled"> with no <skipped/> child. read_report() falls through to passed, so the CLI reports fixed: 1, after.passed: 1, newly_skipped: 0. Starting from a passing baseline also hides the coverage loss. All four existing tests pass.

Please classify the CTest disabled status as skipped in the existing three-state model and add a fixture using this actual report shape. Failed → disabled should give fixed: 0, newly_skipped: 1.

— Codex

**@⁠kawaii-shakal** on GitHub · 2026-11-24 19:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7142060243) At e7aca7e2, a failing test can appear fixed when it is simply disabled. I generated both reports with CTest 4.4.4 on Windows using one synthetic test: run `cmake -E false` for the baseline, then set `DISABLED TRUE` and rerun `ctest --output-junit`. CTest emits `<testcase status="disabled">` with no `<skipped/>` child. `read_report()` falls through to `passed`, so the CLI reports `fixed: 1`, `after.passed: 1`, `newly_skipped: 0`. Starting from a passing baseline also hides the coverage loss. All four existing tests pass. Please classify the CTest disabled status as skipped in the existing three-state model and add a fixture using this actual report shape. Failed → disabled should give `fixed: 0`, `newly_skipped: 1`. — Codex
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 19:44 UTC · original

@⁠kawaii-shakal Thanks for the review! Commit f0297ae42 classifies CTest status="disabled" as skipped, including case-insensitive values, and adds synthetic CTest regression tests for failed-to-disabled and passed-to-disabled transitions. All six junit_triage tests pass.

**@⁠Taffyyy-ops** on GitHub · 2026-11-24 19:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7142530283) @⁠kawaii-shakal Thanks for the review! Commit f0297ae42 classifies CTest status="disabled" as skipped, including case-insensitive values, and adds synthetic CTest regression tests for failed-to-disabled and passed-to-disabled transitions. All six junit_triage tests pass.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:12 UTC · original

Recommendation: [MERGE]

Reasoning: Adds tools/junit_triage.py to compare two JUnit runs and print aggregate transitions, with docs and tests. kawaii-shakal found disabled tests could look fixed; this is fixed in f0297ae42 with regression tests, and KernelSmoker verified the suite. Standalone new tool, no impact on existing code. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 3/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7143199353) **Recommendation:** [MERGE] **Reasoning:** Adds `tools/junit_triage.py` to compare two JUnit runs and print aggregate transitions, with docs and tests. kawaii-shakal found disabled tests could look fixed; this is fixed in f0297ae42 with regression tests, and KernelSmoker verified the suite. Standalone new tool, no impact on existing code. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 3/10
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-25 10:40 UTC · original

@⁠Deedlyy @⁠KernelSmoker @⁠abnalstlll-byte @⁠kawaii-shakal Thanks for the reviews and [MERGE] recommendation!

  • Updated the PR description with a full technical summary ( ools/junit_triage.py, docs/junit_triage.md, ests/test_junit_triage.py).
  • Pushed commit e8f649ffc adding the standard sys.stdout.reconfigure(errors="replace") guard in ools/junit_triage.py's main block to fix the ests/test_tool_stdout_encoding.py CI failure on stdlib-tests-linux and macos-python.
  • Re-verified locally (AI-assisted, synthetic only): ests/test_junit_triage.py (6/6 OK), ests/test_tool_stdout_encoding.py (4/4 OK), ests/test_text_write_line_endings.py (3/3 OK), all 12 ests/test_docs_*.py suites OK, scripts/check_no_game_data.py (␀), and git diff --check (␀).
**@⁠Taffyyy-ops** on GitHub · 2026-11-25 10:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7160027475) @⁠Deedlyy @⁠KernelSmoker @⁠abnalstlll-byte @⁠kawaii-shakal Thanks for the reviews and [MERGE] recommendation! - Updated the PR description with a full technical summary ( ools/junit_triage.py, docs/junit_triage.md, ests/test_junit_triage.py). - Pushed commit `e8f649ffc` adding the standard sys.stdout.reconfigure(errors="replace") guard in ools/junit_triage.py's __main__ block to fix the ests/test_tool_stdout_encoding.py CI failure on stdlib-tests-linux and macos-python. - Re-verified locally (AI-assisted, synthetic only): ests/test_junit_triage.py (6/6 OK), ests/test_tool_stdout_encoding.py (4/4 OK), ests/test_text_write_line_endings.py (3/3 OK), all 12 ests/test_docs_*.py suites OK, scripts/check_no_game_data.py (␀), and git diff --check (␀).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1151/head:github-bot/gh-1151'
git switch 'github-bot/gh-1151'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1151'
git switch 'github-bot/gh-1151'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1151'
git switch 'github-bot/gh-1151'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1151'
git switch 'main'
git merge --squash 'github-bot/gh-1151'
git switch 'main'
git merge --ff-only 'github-bot/gh-1151'
git switch 'main'
git merge 'github-bot/gh-1151'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.