Report Cargo test targets that exit early in red-green #3307

Open
github-bot wants to merge 2 commits from github-bot/gh-3307 into main AGit
Owner

@⁠merzleckeier on GitHub · 2026-12-03 08:00 UTC · original
merzleckeier:codex/red-green-cargo-target-exit → main · +106 −16 · 3 files · 3 commits · open

Claimed as TEST-RED-GREEN-CARGO-TARGET-EXIT. Coordination comment

Depends on: none.

What and why

With cargo test --no-fail-fast, Cargo can finish one test target and then report that another target exited early. The checker used the successful target’s parsed results and could return red then green with exit 0 even though the second executable failed.

Record Cargo’s rerun command when a failed target exits before reporting a test summary. An incomplete red side gets red test run failed. An incomplete green side gets green fails. An interrupted target during a mutation is reported as test run failed. Ordinary assertion failures stay in the per-test results.

Tested

  • Added regression checks for interrupted red and green targets, a mutation, and diagnostic-shaped output from a normal failing test. The tests failed against main and passed with this change.
  • Real Cargo 1.97.1 with two synthetic crates reproduced exit 0 on main and exit 1 with the fix. A separate mutation fixture now reports test run failed instead of not caught.
  • python3 -I tests/test_red_green.py -q: 42 tests, one platform skip. Scratch merge with #3304: 44 tests, one platform skip.
  • git diff --check and python3 -I scripts/check_no_game_data.py docs/testing.md scripts/red_green.py tests/test_red_green.py passed.

GPUs tested: CPU-only checks on Linux. No game files were used.

AI-assisted with OpenAI Codex (GPT-6). A separate read-only Codex GPT reviewer checked the final diff and reproduced the Cargo cases independently. The reviewer’s exact runtime variant was unavailable.

**@⁠merzleckeier** on GitHub · 2026-12-03 08:00 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307) `merzleckeier:codex/red-green-cargo-target-exit` → `main` · +106 −16 · 3 files · 3 commits · open Claimed as `TEST-RED-GREEN-CARGO-TARGET-EXIT`. [Coordination comment](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570) Depends on: none. ### What and why With `cargo test --no-fail-fast`, Cargo can finish one test target and then report that another target exited early. The checker used the successful target’s parsed results and could return `red then green` with exit 0 even though the second executable failed. Record Cargo’s rerun command when a failed target exits before reporting a test summary. An incomplete red side gets `red test run failed`. An incomplete green side gets `green fails`. An interrupted target during a mutation is reported as `test run failed`. Ordinary assertion failures stay in the per-test results. ### Tested - Added regression checks for interrupted red and green targets, a mutation, and diagnostic-shaped output from a normal failing test. The tests failed against `main` and passed with this change. - Real Cargo 1.97.1 with two synthetic crates reproduced exit 0 on `main` and exit 1 with the fix. A separate mutation fixture now reports `test run failed` instead of `not caught`. - `python3 -I tests/test_red_green.py -q`: 42 tests, one platform skip. Scratch merge with #3304: 44 tests, one platform skip. - `git diff --check` and `python3 -I scripts/check_no_game_data.py docs/testing.md scripts/red_green.py tests/test_red_green.py` passed. GPUs tested: CPU-only checks on Linux. No game files were used. AI-assisted with OpenAI Codex (GPT-6). A separate read-only Codex GPT reviewer checked the final diff and reproduced the Cargo cases independently. The reviewer’s exact runtime variant was unavailable.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 08:04:36 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-12-03 08:13 UTC · original

Windows native verification (red -> green) -- PASS on head 11da4b655 (merged cleanly via git merge --no-ff onto main d9b618f10).

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 -> Ran 42 tests in 77.147s / OK
  • Red (reverted scripts/red_green.py to main d9b618f10, keeping the PR's tests/test_red_green.py): Ran 42 tests in 77.838s / FAILED (failures=3) (exit 1)

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

**@⁠lixonik** on GitHub · 2026-12-03 08:13 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7371986555) **Windows native verification (`red -> green`) -- PASS** on head `11da4b655` (merged cleanly via `git merge --no-ff` onto `main` `d9b618f10`). ### 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` -> **Ran 42 tests in 77.147s / OK** - **Red** (reverted `scripts/red_green.py` to `main` `d9b618f10`, keeping the PR's `tests/test_red_green.py`): **Ran 42 tests in 77.838s / FAILED (failures=3)** (exit `1`) AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Author
Owner

@⁠fiestorra on GitHub · 2026-12-03 08:39 UTC · original

Las dos nuevas, corridas

#3306  d3d12 port 2: wrap RTL/safe copy imports & GetProcAddress    8 files, +878/−39
       cargo test -p leonida-gpu --lib  →  720 passed; 1 failed; 59 ignored

#3307  Report Cargo test targets that exit early in red-green       3 files, +106/−16
       pytest tests/test_red_green.py   →  42 passed + 10 subtests  (97 s)

En #3306 el fallo es el de siempre (views_are_made_beside…, la iGPU de esta máquina), y 720 contra los 715 de main — cinco tests más, medidos en el diff.

Y el cambio es de los que no se pueden probar sin el juego: envolver los GetProcAddress del port 2 y marcar las importaciones «al lado» — o sea, hacer que una llamada que no existe en la DLL del juego se vea como tal y no como un salto a la nada. Lo que el test cubre es el envoltorio; lo que no cubre es una DLL real sin ese símbolo.

En #3307 la proporción vuelve a ser la buena: 106 líneas, de las cuales la mayoría son test (+10 subtests sobre los 8 que tenía), en una herramienta de medición. Y es la tercera de la noche sobre red_green (con #3304 y el propio fichero), que empieza a ser el instrumento más revisado del repositorio — y con razón: es el que dice si algo está rojo.

Lo que no verifiqué en ninguna: el caso que las motiva — una DLL del juego sin el símbolo (#3306) y una suite mutada que sale antes de tiempo (#3307). Los dos necesitan un binario concreto, y los dos están simulados en los tests.

**@⁠fiestorra** on GitHub · 2026-12-03 08:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7372556500) ## Las dos nuevas, corridas ``` #3306 d3d12 port 2: wrap RTL/safe copy imports & GetProcAddress 8 files, +878/−39 cargo test -p leonida-gpu --lib → 720 passed; 1 failed; 59 ignored #3307 Report Cargo test targets that exit early in red-green 3 files, +106/−16 pytest tests/test_red_green.py → 42 passed + 10 subtests (97 s) ``` **En `#3306` el fallo es el de siempre** (**`views_are_made_beside…`, la iGPU de esta máquina**), **y `720` contra los `715` de `main`** — **cinco tests más, medidos en el diff.** **Y el cambio es de los que no se pueden probar sin el juego**: **envolver los `GetProcAddress` del *port* 2 y marcar las importaciones «al lado»** — **o sea, hacer que una llamada que no existe en la DLL del juego se vea como tal y no como un salto a la nada.** **Lo que el test cubre es el envoltorio; lo que no cubre es una DLL real sin ese símbolo.** **En `#3307` la proporción vuelve a ser la buena**: **106 líneas, de las cuales la mayoría son test** (**+10 subtests** sobre los 8 que tenía), **en una herramienta de medición.** **Y es la tercera de la noche sobre `red_green`** (**con `#3304` y el propio fichero**), **que empieza a ser el instrumento más revisado del repositorio** — **y con razón: es el que dice si algo está rojo.** **Lo que no verifiqué en ninguna**: **el caso que las motiva** — **una DLL del juego sin el símbolo** (`#3306`) **y una suite mutada que sale antes de tiempo** (`#3307`). **Los dos necesitan un binario concreto, y los dos están simulados en los tests.**
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 09:18 UTC · original

Found a remaining false green on 11da4b65 with real Cargo 1.97.1 and a synthetic Rust crate. The green target starts a child libtest that prints a successful summary, then the enclosing target exits before its own summary. Cargo exits 101 and reports a target failure. red_green.py still exits 0 with red then green and an empty green.test_run_errors list. I reproduced this with enclosing test exit statuses 2 and 101.

The child summary sets target_finished before Cargo reports the enclosing failure. Using Cargo’s process-exit diagnostic is enough for the status-2 case here. Cargo omits that detail for the status-101 case. A local control that tracks the nested libtest starts and summaries reports green fails for both. Its existing checker suite ran 42 tests with 41 passing and one platform skip. The control was exercised locally. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 09:18 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7373471030) Found a remaining false green on `11da4b65` with real Cargo 1.97.1 and a synthetic Rust crate. The green target starts a child libtest that prints a successful summary, then the enclosing target exits before its own summary. Cargo exits 101 and reports a target failure. `red_green.py` still exits 0 with `red then green` and an empty `green.test_run_errors` list. I reproduced this with enclosing test exit statuses 2 and 101. The child summary sets `target_finished` before Cargo reports the enclosing failure. Using Cargo’s process-exit diagnostic is enough for the status-2 case here. Cargo omits that detail for the status-101 case. A local control that tracks the nested libtest starts and summaries reports `green fails` for both. Its existing checker suite ran 42 tests with 41 passing and one platform skip. The control was exercised locally. AI-assisted with OpenAI Codex.
Author
Owner

@⁠icdmkg2 on GitHub · 2026-12-03 11:47 UTC · original

Verified natively on Windows 11 (Python 3.12, no game files): \python -I scripts/red_green.py 3307 --no-cargo\ against \origin/main\ (\053a1813, head \11da4b655) — *\ erdict: red then green* (1 red→green: \Mutation.test_a_mutation_that_interrupts_another_test_target_reports_it, 1 green-only \ok: \Sides.test_a_cargo_target_that_exits_early_cancels_the_sides_verdict, 40 pass on both). AI-assisted: Gemini 4 Neon (Antigravity).

**@⁠icdmkg2** on GitHub · 2026-12-03 11:47 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7377187550) Verified natively on Windows 11 (Python 3.12, no game files): \python -I scripts/red_green.py 3307 --no-cargo\ against \origin/main\ (\053a1813\, head \11da4b655\) — **\ erdict: red then green\** (1 red→green: \Mutation.test_a_mutation_that_interrupts_another_test_target_reports_it\, 1 green-only \ok\: \Sides.test_a_cargo_target_that_exits_early_cancels_the_sides_verdict\, 40 pass on both). AI-assisted: Gemini 4 Neon (Antigravity).
Author
Owner

@⁠aegish-zagi on GitHub · 2026-12-03 14:39 UTC · original

VERIFY-3307 — PASS

  • PR: #3307 | head 11da4b65 | merge with current main 128579e9e: clean (ort merge, no conflicts)
  • Tests run: python3 -I tests/test_red_green.py
  • Red on main: FAILED (failures=3, skipped=3) — the PR's new cases fail against main's scripts/red_green.py
  • Green on PR (merged tree): OK — 42 tests (skipped=3)
  • Diff audit: scripts/red_green.py only (plus its tests and docs/testing.md). The parser now tracks a per-target error: test failed, to rerun pass … line and keeps it only when that target never prints a test result: summary, clearing all such errors when Cargo exits 0 — so a target that exits early is reported instead of silently dropped, without misreporting ordinary failed tests. No game data, stdlib only.
  • Platform: Linux, Python 3.12.3, Profile Z (no GPU)

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

**@⁠aegish-zagi** on GitHub · 2026-12-03 14:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7381810711) VERIFY-3307 — PASS - PR: #3307 | head `11da4b65` | merge with current main `128579e9e`: clean (ort merge, no conflicts) - Tests run: `python3 -I tests/test_red_green.py` - Red on main: FAILED (failures=3, skipped=3) — the PR's new cases fail against main's `scripts/red_green.py` - Green on PR (merged tree): OK — 42 tests (skipped=3) - Diff audit: `scripts/red_green.py` only (plus its tests and `docs/testing.md`). The parser now tracks a per-target `error: test failed, to rerun pass …` line and keeps it only when that target never prints a `test result:` summary, clearing all such errors when Cargo exits 0 — so a target that exits early is reported instead of silently dropped, without misreporting ordinary failed tests. No game data, stdlib only. - Platform: Linux, Python 3.12.3, Profile Z (no GPU) AI-assisted: yes (Muse Wonder, Muse by Meta)
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 14:45 UTC · original

I checked #3224 22e03b5e, #3304 4a848b05, and #3307 11da4b65 together on 128579e9. Merging the three heads in forward and reverse order was conflict-free and produced the identical tree a0046cad. The combined tests/test_red_green.py run under Python 3.14.10 had 44 passes and one Windows-only skip.

One additional mixed run used real Cargo 1.98.1 with synthetic crates plus Python unittest fixtures. The report retained the passing Rust and Python tests, marked the Python parent method failed after a subtest failure, recorded the other Python file as unable to import, and reported the separate Cargo target that exited early. This checks how the three changes compose. AI-assisted (Codex).

**@⁠merzleckeier** on GitHub · 2026-12-03 14:45 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3307#issuecomment-7381983618) I checked #3224 `22e03b5e`, #3304 `4a848b05`, and #3307 `11da4b65` together on `128579e9`. Merging the three heads in forward and reverse order was conflict-free and produced the identical tree `a0046cad`. The combined `tests/test_red_green.py` run under Python 3.14.10 had 44 passes and one Windows-only skip. One additional mixed run used real Cargo 1.98.1 with synthetic crates plus Python unittest fixtures. The report retained the passing Rust and Python tests, marked the Python parent method failed after a subtest failure, recorded the other Python file as unable to import, and reported the separate Cargo target that exited early. This checks how the three changes compose. AI-assisted (Codex).
Preserve the PowerShell mutation coverage from main and document the interrupted-target verdicts from this branch. AI-assisted with OpenAI Codex and independently reviewed by GPT-6.2 Sol.
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/3307/head:github-bot/gh-3307'
git switch 'github-bot/gh-3307'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3307'
git switch 'github-bot/gh-3307'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3307'
git switch 'github-bot/gh-3307'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3307'
git switch 'main'
git merge --squash 'github-bot/gh-3307'
git switch 'main'
git merge --ff-only 'github-bot/gh-3307'
git switch 'main'
git merge 'github-bot/gh-3307'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!3307
No description provided.