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

Merged
Taffyyy-ops merged 3 commits from upstream-pr/1151 into main 2026-11-28 08:02:40 +00:00
Taffyyy-ops commented 2026-11-24 19:14:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T19:14:55Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478685075 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1151). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T19:14:55Z. --- 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`.
KernelSmoker commented 2026-11-24 19:16:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T19:16:51Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045747906 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1151#pullrequestreview-6045747906). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T19:16:51Z. **Review:** APPROVED --- 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.
abnalstlll-byte commented 2026-11-24 19:22:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:22:23Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045836016 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1151#pullrequestreview-6045836016). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:22:23Z. **Review:** APPROVED --- 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.
kawaii-shakal commented 2026-11-24 19:24:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T19:24:51Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142060243 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7142060243). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-24T19:24:51Z. --- 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
Taffyyy-ops commented 2026-11-24 19:44:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T19:44:47Z.


@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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142530283 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7142530283). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T19:44:47Z. --- @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.
Deedlyy commented 2026-11-24 20:12:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:12:50Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143199353 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7143199353). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:12:50Z. --- **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
Taffyyy-ops commented 2026-11-25 10:40:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:40:51Z.


@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 (�).
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7160027475 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1151#issuecomment-7160027475). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-25T10:40:51Z. --- @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 (�).
DadaCap commented 2026-11-28 08:02:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:02:43Z.


Merged into main (merge commit 4a2609e79), approved by DadaCap (maintainer). Thanks!

Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (e8f649ffc).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236325327 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1151#issuecomment-7236325327). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:02:43Z. --- Merged into `main` (merge commit 4a2609e79), approved by DadaCap (maintainer). Thanks! Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (e8f649ffc). _AI-assisted (Claude Code), posted for DadaCap._
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1151
No description provided.