test(release): the git-cliff stand-in is a .cmd on Windows, which can start it #145

Open
d4nkn3ss wants to merge 1 commit from d4nkn3ss/Longshot:fix/test-release-cliff-stub-windows into main
Contributor

Why

tests/test_release.py's test_the_first_notes_give_git_cliff_no_range (added in #116) errors on every Windows run: its git-cliff stand-in is a #!/bin/sh script, which Windows can't start.

What changed

  • tests: in tests/test_release.py, on Windows the stand-in is git-cliff-stub.cmd (@echo %*), which echoes its arguments on one line; the test reads them with .split() either way. Elsewhere the shell script stays as it was.

Flags and settings

None

Measurements

main: e28236b4 (2026-11-12)
this PR: fix/test-release-cliff-stub-windows @ ef339b94
Hardware: Windows 11, Python 3.12 from python.org
Scene: n/a (game-free)
Method: python -I -B tests/test_release.py Bump.test_the_first_notes_give_git_cliff_no_range on both sides
How to reproduce: on Windows, the command above

main @ e28236b4 this PR @ ef339b94
test_the_first_notes_give_git_cliff_no_range ERROR: OSError: [WinError 193] %1 is not a valid Win32 application OK

Testing

Tested: the row above on Windows 11.

Full suite: python -I -B tests/run_all.py on this branch @ ef339b94: 500 passed, 3 failed, 35 skipped, the same three as main @ e28236b4: tests/test_check_third_party.py (#80), tests/test_setup_runtime.py (#118) and tests/test_release.py, whose other failures are #119 (the SHA256SUMS fixture) and, from PowerShell, the missing openssl (#144).

Not tested: Linux and macOS: the shell-script branch is the code as it was.

Needs other testers: None

Screenshots

Nothing on screen

Risk and rollback

Tests only; reverting the commit is enough.

Issues

None

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing. (Test-only change: nothing in the game.)
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (A test result: the same on every run.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

🤖 Generated with Claude Code

## Why `tests/test_release.py`'s `test_the_first_notes_give_git_cliff_no_range` (added in #116) errors on every Windows run: its git-cliff stand-in is a `#!/bin/sh` script, which Windows can't start. ## What changed - tests: in `tests/test_release.py`, on Windows the stand-in is `git-cliff-stub.cmd` (`@echo %*`), which echoes its arguments on one line; the test reads them with `.split()` either way. Elsewhere the shell script stays as it was. ## Flags and settings None ## Measurements main: e28236b4 (2026-11-12) this PR: fix/test-release-cliff-stub-windows @ ef339b94 Hardware: Windows 11, Python 3.12 from python.org Scene: n/a (game-free) Method: `python -I -B tests/test_release.py Bump.test_the_first_notes_give_git_cliff_no_range` on both sides How to reproduce: on Windows, the command above | | main @ e28236b4 | this PR @ ef339b94 | |---|---|---| | `test_the_first_notes_give_git_cliff_no_range` | ERROR: `OSError: [WinError 193] %1 is not a valid Win32 application` | OK | ## Testing **Tested:** the row above on Windows 11. **Full suite:** `python -I -B tests/run_all.py` on this branch @ ef339b94: 500 passed, 3 failed, 35 skipped, the same three as main @ e28236b4: `tests/test_check_third_party.py` (#80), `tests/test_setup_runtime.py` (#118) and `tests/test_release.py`, whose other failures are #119 (the SHA256SUMS fixture) and, from PowerShell, the missing `openssl` (#144). **Not tested:** Linux and macOS: the shell-script branch is the code as it was. **Needs other testers:** None ## Screenshots Nothing on screen ## Risk and rollback Tests only; reverting the commit is enough. ## Issues None ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. (Test-only change: nothing in the game.) - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (A test result: the same on every run.) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(release): the git-cliff stand-in is a .cmd on Windows, which can start it
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
ef339b9442
test_the_first_notes_give_git_cliff_no_range (#116) gave release.notes() a #!/bin/sh script as GIT_CLIFF; Windows
can't start one (OSError: [WinError 193] %1 is not a valid Win32 application), so the test errored on Windows. There
the stand-in is a .cmd that echoes its arguments on one line, which the test's .split() reads the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
monsterlag left a comment

Requesting changes at ef339b94. The .cmd does fix WinError193 for an ASCII temporary path, but its output is not the UTF-8 that release.notes requires.

  1. [P2] Emit UTF-8 from the Windows stand-in (tests/test_release.py:220). On native Windows Python3.14.7, set TEMP/TMP to an authored folder containing Zoë and run only Bump.test_the_first_notes_give_git_cliff_no_range. This head fails: cmd echo writes byte0x89 for ë in the echoed --config path, the release.notes UTF-8 reader raises UnicodeDecodeError, then p.stdout is None and .strip raises AttributeError. The same case passes under an ASCII TEMP path. A Windows user with a non-ASCII account/TEMP path therefore still cannot run this check. Use a stand-in that emits explicit UTF-8 and add a Unicode-path regression while keeping the range assertions. PR255's follow-up01943afa addresses both Unicode paths and output encoding; its same case passes in the accented TEMP here, and may be useful when reconciling the overlap.

This is a focused authored-fixture check; no real release creation, token operation or game run. I did not repeat the whole suite or change its assertions.

Requesting changes at ef339b94. The .cmd does fix WinError193 for an ASCII temporary path, but its output is not the UTF-8 that release.notes requires. 1. [P2] Emit UTF-8 from the Windows stand-in (tests/test_release.py:220). On native Windows Python3.14.7, set TEMP/TMP to an authored folder containing Zoë and run only Bump.test_the_first_notes_give_git_cliff_no_range. This head fails: cmd echo writes byte0x89 for ë in the echoed --config path, the release.notes UTF-8 reader raises UnicodeDecodeError, then p.stdout is None and .strip raises AttributeError. The same case passes under an ASCII TEMP path. A Windows user with a non-ASCII account/TEMP path therefore still cannot run this check. Use a stand-in that emits explicit UTF-8 and add a Unicode-path regression while keeping the range assertions. PR255's follow-up01943afa addresses both Unicode paths and output encoding; its same case passes in the accented TEMP here, and may be useful when reconciling the overlap. This is a focused authored-fixture check; no real release creation, token operation or game run. I did not repeat the whole suite or change its assertions.
@ -220,1 +218,3 @@
stub.chmod(0o755)
if os.name == "nt": # (Windows starts a .cmd, not a #! script: WinError 193. It echoes its arguments on one line)
stub = self.dir / "git-cliff-stub.cmd"
stub.write_text("@echo %*\r\n", encoding="utf-8")
First-time contributor

[P2] This echoes in the Windows console code page, but release.notes decodes UTF-8. Reproduced with TEMP/TMP containing Zoë: byte 0x89 in the --config path causes UnicodeDecodeError, then p.stdout.strip fails because stdout is None. The identical case passes with an ASCII TEMP. Please emit explicit UTF-8 and cover a Unicode path; PR255 follow-up01943afa already does this and passes the same probe.

[P2] This echoes in the Windows console code page, but release.notes decodes UTF-8. Reproduced with TEMP/TMP containing Zoë: byte 0x89 in the --config path causes UnicodeDecodeError, then p.stdout.strip fails because stdout is None. The identical case passes with an ASCII TEMP. Please emit explicit UTF-8 and cover a Unicode path; PR255 follow-up01943afa already does this and passes the same probe.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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 'fix/test-release-cliff-stub-windows:d4nkn3ss-fix/test-release-cliff-stub-windows'
git switch 'd4nkn3ss-fix/test-release-cliff-stub-windows'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!145
No description provided.