test(release): the publish test writes its SHA256SUMS fixture as bytes, so it passes on Windows #119

Open
d4nkn3ss wants to merge 2 commits from d4nkn3ss/Longshot:fix/test-release-crlf into main
Contributor

Why

tests/test_release.py fails on main on Windows: its fixtures write SHA256SUMS as text, which Windows writes with `

`, so the publish test's upload doesn't match and the released-as tests' signature doesn't verify.

What changed

  • tests: tests/test_release.py writes its SHA256SUMS fixtures as bytes, write_bytes(...), not write_text(...): in test_a_draft_then_the_files_then_published, and in ReleasedAs's release fixture (added on main since), whose signature is made over that file and checked against the uploaded bytes. scripts/release.py uploads and verifies each file as it is, which is right, so only the fixtures change.

Flags and settings

None

Measurements

main: 3ece96e9 (2026-11-13)
this PR: fix/test-release-crlf @ 6ce385fc
Hardware: Windows 11, Python 3.12 from python.org
Scene: n/a (game-free)
Method: python -I -B tests/test_release.py once on each side, same checkout
How to reproduce: on Windows, python -I -B tests/test_release.py

main @ 3ece96e9 this PR @ 6ce385fc
tests/test_release.py FAILED (failures=1): ('SHA256SUMS', b'sums\r\n') != ('SHA256SUMS', b'sums\n') OK (18 tests)

Testing

Tested: the command above on Windows 11 on both sides.

Full suite: python -I -B tests/run_all.py on this branch @ ba460632, Windows 11: 493 passed, 3 failed, 35 skipped. The failures: tests/test_check_third_party.py (#80), tests/test_setup_runtime.py (#118), and tests/test_release.py itself only because openssl wasn't on that shell's PATH (its key tests need the command line; with Git's openssl on PATH: main @ cf0dbb34 0 passed 1 failed, this PR 1 passed 0 failed).

Not tested: Linux: write_text already wrote \n there, so the test passed before and the bytes are the same now.

Needs other testers: None

Screenshots

Nothing on screen

Risk and rollback

Test-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` fails on `main` on Windows: its fixtures write `SHA256SUMS` as text, which Windows writes with ` `, so the publish test's upload doesn't match and the released-as tests' signature doesn't verify. ## What changed - tests: `tests/test_release.py` writes its `SHA256SUMS` fixtures as bytes, `write_bytes(...)`, not `write_text(...)`: in `test_a_draft_then_the_files_then_published`, and in `ReleasedAs`'s release fixture (added on main since), whose signature is made over that file and checked against the uploaded ` ` bytes. `scripts/release.py` uploads and verifies each file as it is, which is right, so only the fixtures change. ## Flags and settings None ## Measurements main: 3ece96e9 (2026-11-13) this PR: fix/test-release-crlf @ 6ce385fc Hardware: Windows 11, Python 3.12 from python.org Scene: n/a (game-free) Method: `python -I -B tests/test_release.py` once on each side, same checkout How to reproduce: on Windows, `python -I -B tests/test_release.py` | | main @ 3ece96e9 | this PR @ 6ce385fc | |---|---|---| | `tests/test_release.py` | FAILED (failures=1): `('SHA256SUMS', b'sums\r\n') != ('SHA256SUMS', b'sums\n')` | OK (18 tests) | ## Testing **Tested:** the command above on Windows 11 on both sides. **Full suite:** `python -I -B tests/run_all.py` on this branch @ ba460632, Windows 11: 493 passed, 3 failed, 35 skipped. The failures: `tests/test_check_third_party.py` (#80), `tests/test_setup_runtime.py` (#118), and `tests/test_release.py` itself only because `openssl` wasn't on that shell's PATH (its key tests need the command line; with Git's `openssl` on PATH: main @ cf0dbb34 0 passed 1 failed, this PR 1 passed 0 failed). **Not tested:** Linux: `write_text` already wrote `\n` there, so the test passed before and the bytes are the same now. **Needs other testers:** None ## Screenshots Nothing on screen ## Risk and rollback Test-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)
Author
Contributor

Full game-free suite run on this branch (Windows 11); the results and the failures that also fail on main are now under Testing. Marking ready.

Full game-free suite run on this branch (Windows 11); the results and the failures that also fail on main are now under Testing. Marking ready.
d4nkn3ss changed title from WIP: test(release): the publish test writes its SHA256SUMS fixture as bytes, so it passes on Windows to test(release): the publish test writes its SHA256SUMS fixture as bytes, so it passes on Windows 2026-11-13 06:18:38 +00:00
d4nkn3ss force-pushed fix/test-release-crlf from ba460632fb
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 7s
to 6ce385fc11
All checks were successful
PR description / Description follows the template (pull_request_target) Successful in 11s
2026-11-13 08:35:52 +00:00
Compare
Author
Contributor

Rebased onto main 3ece96e9 and extended: the ReleasedAs tests added on main since write their signed SHA256SUMS as text too, so all four errored on Windows ("its SHA256SUMS is not signed by a trusted key"). Their fixture now writes bytes as well; with openssl on PATH, tests/test_release.py goes from 5 errors and 1 failure to the one git-cliff error #145 fixes. Description updated.

Rebased onto main 3ece96e9 and extended: the ReleasedAs tests added on main since write their signed SHA256SUMS as text too, so all four errored on Windows ("its SHA256SUMS is not signed by a trusted key"). Their fixture now writes bytes as well; with openssl on PATH, tests/test_release.py goes from 5 errors and 1 failure to the one git-cliff error #145 fixes. Description updated.
All checks were successful
PR description / Description follows the template (pull_request_target) Successful in 11s
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-crlf:d4nkn3ss-fix/test-release-crlf'
git switch 'd4nkn3ss-fix/test-release-crlf'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!119
No description provided.