Count failed Python subtests in red-green reports #3224

Merged
merzleckeier merged 2 commits from upstream-pr/3224 into main 2026-12-03 16:10:21 +00:00
merzleckeier commented 2026-12-02 20:40:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:40:50Z.


Claimed in the coordination issue as TEST-RED-GREEN-PYTHON-SUBTEST-FAILURES.

What and why

When a unittest subtest fails, the verbose parent line has no result. The checker used to miss the failure entirely. Read the failure summary and count its assertion failures and errors under the parent method. Full verbose results still take precedence. Accept Windows CRLF in the multiline method descriptions as well.

Tested

  • Synthetic Git fixture: two assertion failures in one method and an exception in another. The old checker reports red does not build. The updated checker lists both parent methods as red-to-green and catches the Python mutation. A passing test that prints a failure heading passes on both sides.
  • The real #3220 head 0beb7d26 changes from no red to red then green on the same base. This comparison checks the launcher test result. PowerShell source mutations are outside the checker's current scope.
  • The targeted test passed on Linux and on Windows CPython 3.12.10 under Wine 11.22 with MinGit. The checker changes in #3181 and #3203 merge cleanly with this branch. The no-game-data and whitespace checks passed.

GPUs tested: n/a (synthetic Git and unittest fixtures).

AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the exact head read-only and tested LF and CRLF parsing.

Checklist

  • Based on upstream main at b41763227.
  • One topic.
  • Synthetic fixtures only.
  • Translator rule: n/a.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5614334058 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3224). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:40:50Z. --- Claimed in the coordination issue as [TEST-RED-GREEN-PYTHON-SUBTEST-FAILURES](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7357923961). ### What and why When a `unittest` subtest fails, the verbose parent line has no result. The checker used to miss the failure entirely. Read the failure summary and count its assertion failures and errors under the parent method. Full verbose results still take precedence. Accept Windows CRLF in the multiline method descriptions as well. ### Tested - Synthetic Git fixture: two assertion failures in one method and an exception in another. The old checker reports `red does not build`. The updated checker lists both parent methods as red-to-green and catches the Python mutation. A passing test that prints a failure heading passes on both sides. - The real #3220 head `0beb7d26` changes from `no red` to `red then green` on the same base. This comparison checks the launcher test result. PowerShell source mutations are outside the checker's current scope. - The targeted test passed on Linux and on Windows CPython 3.12.10 under Wine 11.22 with MinGit. The checker changes in #3181 and #3203 merge cleanly with this branch. The no-game-data and whitespace checks passed. GPUs tested: n/a (synthetic Git and unittest fixtures). AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the exact head read-only and tested LF and CRLF parsing. ### Checklist - [x] Based on upstream `main` at `b41763227`. - [x] One topic. - [x] Synthetic fixtures only. - Translator rule: n/a.
merzleckeier commented 2026-12-02 20:44:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:44:00Z.


Additional verification on 22e03b5e: all 38 tests in tests/test_red_green.py passed with Windows CPython 3.12.10 and MinGit under Wine 11.22. A clean local combination with #3181 (1c62cfc6) and #3203 (d7deb51a) ran 42 test cases on Linux (41 passed, one platform-only skip). git merge-tree is also clean against the newly advanced upstream main at 8d82a34a. Synthetic repositories only. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358225649 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3224#issuecomment-7358225649). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:44:00Z. --- Additional verification on `22e03b5e`: all 38 tests in `tests/test_red_green.py` passed with Windows CPython 3.12.10 and MinGit under Wine 11.22. A clean local combination with #3181 (`1c62cfc6`) and #3203 (`d7deb51a`) ran 42 test cases on Linux (41 passed, one platform-only skip). `git merge-tree` is also clean against the newly advanced upstream `main` at `8d82a34a`. Synthetic repositories only. AI-assisted.
fiestorra commented 2026-12-02 21:32:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:32:12Z.


VERIFY-3224 — Windows nativo: red then green, y el caso CRLF es el que importa aquí

Head (this PR)
Merge base b41763227 = current main

Ran

python -I tests/test_red_green.py      Ran 38 tests in 93.7s — OK

Negative control (scripts/red_green.py reverted to main, the PR's tests kept):

FAIL: test_failed_python_subtests_count_against_their_parent_methods
Ran 38 tests — FAILED (failures=1)

Why this one matters to me: I spent tonight reading red_green.py verdicts, and the failure it fixes is the one that would have hidden a real failure from me — a failed subtest leaves its parent's verbose line unfinished, so the old parser never counted it, and a pull request whose Python tests only failed inside subTest would read as green. The \r?\n fix in PY_TEST is the other half: on a Windows checkout the verbose lines end in CRLF, and a regex anchored on \n misses them — that is the kind of thing that passes on the author's Linux box and fails for everyone running it here. My run is on native Windows, so it exercised the CRLF path.

What I could not test: a real pull request whose Python side fails only in a subtest, end to end through --mutate; the tests build that situation synthetically.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359418307 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3224#issuecomment-7359418307). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T21:32:12Z. --- ## VERIFY-3224 — Windows nativo: `red then green`, y el caso CRLF es el que importa aquí | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | **Ran** ``` python -I tests/test_red_green.py Ran 38 tests in 93.7s — OK ``` **Negative control** (`scripts/red_green.py` reverted to `main`, the PR's tests kept): ``` FAIL: test_failed_python_subtests_count_against_their_parent_methods Ran 38 tests — FAILED (failures=1) ``` **Why this one matters to me**: I spent tonight reading `red_green.py` verdicts, and the failure it fixes is the one that would have hidden a real failure from me — **a failed subtest leaves its parent's verbose line unfinished, so the old parser never counted it**, and a pull request whose Python tests only failed inside `subTest` would read as green. The `\r?\n` fix in `PY_TEST` is the other half: **on a Windows checkout the verbose lines end in CRLF**, and a regex anchored on `\n` misses them — that is the kind of thing that passes on the author's Linux box and fails for everyone running it here. **My run is on native Windows**, so it exercised the CRLF path. **What I could not test**: a real pull request whose Python side fails only in a subtest, end to end through `--mutate`; the tests build that situation synthetically. Written with an AI assistant.
lixonik commented 2026-12-02 22:47:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T22:47:44Z.


Windows native verification (red -> green) -- PASS on head 22e03b5ec (merged cleanly via git merge --no-ff onto main 16243cd6e).

Checks (Windows 10 x64, Python 3.12)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green (python -I tests/test_red_green.py -v on merged head 22e03b5ec): Ran 41 tests in 73.807s / OK
  • Red (reverted scripts/red_green.py to main 16243cd6e, keeping the PR's tests/test_red_green.py): Ran 41 tests in 73.240s / FAILED (failures=1)

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361170607 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3224#issuecomment-7361170607). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T22:47:44Z. --- **Windows native verification (`red -> green`) -- PASS** on head `22e03b5ec` (merged cleanly via `git merge --no-ff` onto `main` `16243cd6e`). ### Checks (Windows 10 x64, Python 3.12) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green** (`python -I tests/test_red_green.py -v` on merged head `22e03b5ec`): **Ran 41 tests in 73.807s / OK** - **Red** (reverted `scripts/red_green.py` to `main` `16243cd6e`, keeping the PR's `tests/test_red_green.py`): **Ran 41 tests in 73.240s / FAILED (failures=1)** AI-assisted: yes (Antigravity -- Gemini 4 Neon).
aegish-zagi commented 2026-12-03 14:43:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-03T14:43:25Z.


VERIFY-3224 — PASS

  • PR: #3224 | head 22e03b5e | merge with current main 128579e9e: clean (ort merge, auto-merged scripts/red_green.py / tests/test_red_green.py, no conflicts)
  • Tests run: python3 -I tests/test_red_green.py
  • Red on main: FAILED (failures=1, skipped=3) — the PR's new subtest-counting case fails against main's scripts/red_green.py
  • Green on PR (merged tree): OK — 41 tests (skipped=3)
  • Diff audit: scripts/red_green.py plus its tests; failed Python subtests are now counted in red-green reports instead of being dropped from the tally. No game data, stdlib only.
  • Platform: Linux, Python 3.12.3, Profile Z (no GPU)

AI-assisted: yes (Muse Wonder, Muse by Meta)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381921256 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3224#issuecomment-7381921256). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-12-03T14:43:25Z. --- VERIFY-3224 — PASS - PR: #3224 | head `22e03b5e` | merge with current main `128579e9e`: clean (ort merge, auto-merged `scripts/red_green.py` / `tests/test_red_green.py`, no conflicts) - Tests run: `python3 -I tests/test_red_green.py` - Red on main: FAILED (failures=1, skipped=3) — the PR's new subtest-counting case fails against main's `scripts/red_green.py` - Green on PR (merged tree): OK — 41 tests (skipped=3) - Diff audit: `scripts/red_green.py` plus its tests; failed Python subtests are now counted in red-green reports instead of being dropped from the tally. No game data, stdlib only. - Platform: Linux, Python 3.12.3, Profile Z (no GPU) AI-assisted: yes (Muse Wonder, Muse by Meta)
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!3224
No description provided.