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

Merged
leonida/mandy
Taffyyy-ops merged 3 commits from feat/junit-triage into main 2026-11-28 08:02:40 +00:00

Pull request successfully merged and closed

Taffyyy-ops commented 2026-11-24 19:14:55 +00:00

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.
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 approved these changes 2026-11-24 19:16:51 +00:00
KernelSmoker left a comment

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.

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 approved these changes 2026-11-24 19:22:23 +00:00
abnalstlll-byte left a comment

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.

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

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

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

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

@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

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

**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

@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 (�).
@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

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.

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 description provided.