feat(tools): emit skip policy decisions as JSON #12750

Merged
StoneDC merged 8 commits from upstream-pr/12750 into main 2026-11-07 13:36:44 +00:00
StoneDC commented 2026-10-29 07:36:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-29T07:36:20Z.


What

Add optional JSON output to the skip-policy checker. The report includes the job policy, sorted skipped tests, raw output, occurrence count, expected status and unexpected names. It uses the same policy decisions and exit status as text mode.

Synchronize with main 090f57166adb9692d27d16662a89ccc33a502406. Duplicate JUnit testcase names are rejected in both text and JSON modes with exit 2. The previous duplicate-grouping regression is updated to assert this current validation rule. The merge retains current raw-socket, shared-memory, CTest-status and report-validation handling.

Tested

At b187072b4fe0b3af690f847dcfe681b0367ea837, Windows and Linux with Python 3.12 and 3.14 each passed both registered CTest groups (44 unittest cases, zero skips). The groups cover policy parsing and real CTest-generated JUnit reports. Regressions compare text/JSON errors for duplicate names, full JSON objects for raw-socket and shared-memory limitations, unexpected reasons, CTest skip status, CLI errors and both platform policies.

Current-main conventions with the complete description, Python 3.9 grammar, script registration, whitespace and merge checks pass. Hosted checks for the new revision are tracked on the PR. Checks

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5064168791 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12750). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-29T07:36:20Z. --- ### What Add optional JSON output to the skip-policy checker. The report includes the job policy, sorted skipped tests, raw output, occurrence count, expected status and unexpected names. It uses the same policy decisions and exit status as text mode. Synchronize with main `090f57166adb9692d27d16662a89ccc33a502406`. Duplicate JUnit testcase names are rejected in both text and JSON modes with exit 2. The previous duplicate-grouping regression is updated to assert this current validation rule. The merge retains current raw-socket, shared-memory, CTest-status and report-validation handling. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> At `b187072b4fe0b3af690f847dcfe681b0367ea837`, Windows and Linux with Python 3.12 and 3.14 each passed both registered CTest groups (44 unittest cases, zero skips). The groups cover policy parsing and real CTest-generated JUnit reports. Regressions compare text/JSON errors for duplicate names, full JSON objects for raw-socket and shared-memory limitations, unexpected reasons, CTest skip status, CLI errors and both platform policies. Current-main conventions with the complete description, Python 3.9 grammar, script registration, whitespace and merge checks pass. Hosted checks for the new revision are tracked on the PR. [Checks](https://github.com/boykopovar/AnyPS5/pull/12750/checks) ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
rooklz commented 2026-10-29 10:49:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T10:49:05Z.

Review: COMMENTED


Reviewed exact head b14b53e233 on macOS arm64 against current main 1db077e876: git merge-tree is clean and git diff --check is clean. test_check_skips.py and test_check_skips_ctest.py both pass on Python 3.13.13 and 3.9.6. On Homebrew 3.15 they fail, and main's copies fail the same way, because that interpreter's pyexpat is broken on this machine. That failure is environmental and has nothing to do with this PR.

Policy decisions are correct for both jobs. I ran a report containing the duplicate names a (one expected occurrence, one unexpected) and c (two unexpected occurrences). JSON expected matches text mode, rc is 1 in both, and --json --list is rejected as described.

Two points about the duplicate-name behaviour the description promises:

  1. Nothing tests it. I made three mutations together in main(): "occurrences": 1, "output": outputs[-1], and "unexpected": sorted(set(unexpected)). Both modules still pass. The current tests never put a name in a report twice, so the grouping, the count and the "unexpected if any occurrence fails" rule are unpinned. A single report with <testcase name="a"> skipped twice (one reason expected, one not) would cover all three.

  2. unexpected repeats grouped names. For the report above, skips has one entry per name (a, b, c), but unexpected is ["a", "c", "c"]. This matches text mode, which prints error: c skipped twice. Still, a JSON consumer gets two different cardinalities in one document. The cleanest fix is probably to state which one is intended and pin it in the test: either unexpected lists occurrences (so document it), or it lists names (sorted(set(unexpected))).

Minor: the output strings keep the doubled prefix that skips() builds ("skipped, skipped, no display\n\n"). That comes from main's internal representation, not this PR, but it is now part of the JSON contract. If consumers are meant to read the reason, a reason field like the one --list derives might be the better thing to expose.

No blocking issue in the policy logic.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696486126 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12750#pullrequestreview-5696486126). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-29T10:49:05Z. **Review:** COMMENTED --- Reviewed exact head b14b53e233 on macOS arm64 against current main 1db077e876: `git merge-tree` is clean and `git diff --check` is clean. `test_check_skips.py` and `test_check_skips_ctest.py` both pass on Python 3.13.13 and 3.9.6. On Homebrew 3.15 they fail, and main's copies fail the same way, because that interpreter's pyexpat is broken on this machine. That failure is environmental and has nothing to do with this PR. Policy decisions are correct for both jobs. I ran a report containing the duplicate names `a` (one expected occurrence, one unexpected) and `c` (two unexpected occurrences). JSON `expected` matches text mode, rc is 1 in both, and `--json --list` is rejected as described. Two points about the duplicate-name behaviour the description promises: 1. **Nothing tests it.** I made three mutations together in `main()`: `"occurrences": 1`, `"output": outputs[-1]`, and `"unexpected": sorted(set(unexpected))`. Both modules still pass. The current tests never put a name in a report twice, so the grouping, the count and the "unexpected if any occurrence fails" rule are unpinned. A single report with `<testcase name="a">` skipped twice (one reason expected, one not) would cover all three. 2. **`unexpected` repeats grouped names.** For the report above, `skips` has one entry per name (`a`, `b`, `c`), but `unexpected` is `["a", "c", "c"]`. This matches text mode, which prints `error: c skipped` twice. Still, a JSON consumer gets two different cardinalities in one document. The cleanest fix is probably to state which one is intended and pin it in the test: either `unexpected` lists occurrences (so document it), or it lists names (`sorted(set(unexpected))`). Minor: the `output` strings keep the doubled prefix that `skips()` builds (`"skipped, skipped, no display\n\n"`). That comes from main's internal representation, not this PR, but it is now part of the JSON contract. If consumers are meant to read the reason, a `reason` field like the one `--list` derives might be the better thing to expose. No blocking issue in the policy logic.
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
boykopovar/AnyPS5!12750
No description provided.