conformance run.ps1: propagate exit status and guard blank or root output #2337

Merged
kirigayakazima merged 1 commit from upstream-pr/2337 into main 2026-11-28 15:11:18 +00:00
kirigayakazima commented 2026-11-26 14:05:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-26T14:05:07Z.


Claimed in the coordination issue as: CONFORMANCE-RUN-PS1-EXIT-PROPAGATION-AND-WHITESPACE-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194174248)

What and why

  • Propagate & $exe $Output @Extra exit status via $rc = $LASTEXITCODE; Write-Output "EXITCODE $rc"; exit $rc in tools/conformance/native/scripts/run.ps1 instead of always exiting 0 when the native conformance renderer fails.
  • Refuse whitespace-only -Output values (is blank) while keeping omitted/empty -Output defaulting to out/run1, and explicitly refuse -Output resolving to the tools/conformance/native folder itself (exit 2).
  • Update tests/test_conformance_run_script.py to use an exit-0 stub executable instead of where.exe (which returned exit code 2 for backslash paths and triggered assertNotEqual(code, 2) once run.ps1 propagated exit codes), and add regression tests in tests/test_conformance_run_exit.py.

Tested

  • python -I tests/test_conformance_run_exit.py -v: 2 passed, 0 failed (detached upstream/main baseline with only the new test file fails with 3 failures).
  • python -I tests/test_conformance_run_script.py -v: 7 passed, 0 failed.
  • python -I tests/test_ci_registration.py: 16 passed.
  • python -I tests/test_text_write_line_endings.py: 3 passed.
  • python -I scripts/check_no_game_data.py, python -I -m compileall -q tests/test_conformance_run_script.py tests/test_conformance_run_exit.py, and git diff --cached --check: passed.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5511466003 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2337). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-26T14:05:07Z. --- Claimed in the coordination issue as: CONFORMANCE-RUN-PS1-EXIT-PROPAGATION-AND-WHITESPACE-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194174248) ### What and why - Propagate `& $exe $Output @Extra` exit status via `$rc = $LASTEXITCODE; Write-Output "EXITCODE $rc"; exit $rc` in `tools/conformance/native/scripts/run.ps1` instead of always exiting `0` when the native conformance renderer fails. - Refuse whitespace-only `-Output` values (`is blank`) while keeping omitted/empty `-Output` defaulting to `out/run1`, and explicitly refuse `-Output` resolving to the `tools/conformance/native` folder itself (`exit 2`). - Update `tests/test_conformance_run_script.py` to use an exit-0 stub executable instead of `where.exe` (which returned exit code `2` for backslash paths and triggered `assertNotEqual(code, 2)` once `run.ps1` propagated exit codes), and add regression tests in `tests/test_conformance_run_exit.py`. ### Tested - `python -I tests/test_conformance_run_exit.py -v`: 2 passed, 0 failed (detached `upstream/main` baseline with only the new test file fails with 3 failures). - `python -I tests/test_conformance_run_script.py -v`: 7 passed, 0 failed. - `python -I tests/test_ci_registration.py`: 16 passed. - `python -I tests/test_text_write_line_endings.py`: 3 passed. - `python -I scripts/check_no_game_data.py`, `python -I -m compileall -q tests/test_conformance_run_script.py tests/test_conformance_run_exit.py`, and `git diff --cached --check`: passed. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
zmasi commented 2026-11-28 07:35:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T07:35:45Z.


#2337 | head 6873202cfb (merged cleanly with main 09c153948) | python -I tests/test_conformance_run_exit.py && python -I tests/test_conformance_run_script.py | red on main: FAILED (failures=3) (0 != 7 on renderer exit code propagation and blank -Output falling through to current working folder instead of 'is blank') | green on PR+main: 2 tests OK and 7 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited tools/conformance/native/scripts/run.ps1 (whitespace -Output check before IsNullOrEmpty fallback, native-conformance-root self-deletion guard, and exit $rc propagation), and verified both PR + main (09c153948) and a combined main + #2340 + #2337 merge (0 conflicts; 2 OK + 2 OK + 7 OK under Windows PowerShell). Also passed tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), tests/test_runner_calls_all_tests.py (3 OK), and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236040851 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2337#issuecomment-7236040851). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T07:35:45Z. --- #2337 | head 6873202cfb159c628ae72cf3d24fc2ca1dda7630 (merged cleanly with main 09c153948) | `python -I tests/test_conformance_run_exit.py && python -I tests/test_conformance_run_script.py` | red on main: `FAILED (failures=3)` (`0 != 7` on renderer exit code propagation and blank `-Output` falling through to current working folder instead of `'is blank'`) | green on PR+main: `2 tests OK` and `7 tests OK` | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `tools/conformance/native/scripts/run.ps1` (whitespace `-Output` check before `IsNullOrEmpty` fallback, native-conformance-root self-deletion guard, and `exit $rc` propagation), and verified both `PR + main` (`09c153948`) and a combined `main + #2340 + #2337` merge (`0` conflicts; `2 OK` + `2 OK` + `7 OK` under Windows PowerShell). Also passed `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), `tests/test_runner_calls_all_tests.py` (`3 OK`), and `scripts/check_no_game_data.py`.
MoonEyes commented 2026-11-28 15:11:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:11:15Z.


Red/green: classified READY by cloud-6 (red on main 09c153948, green on head merged with main); head 6873202cfb unchanged since 2026-11-26, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7241270994 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2337#issuecomment-7241270994). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T15:11:15Z. --- Red/green: classified READY by cloud-6 (red on main 09c153948, green on head merged with main); head 6873202cfb15 unchanged since 2026-11-26, before that run. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
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!2337
No description provided.