tests: boot journal seed test compares the temp folder's long spelling (TEST-BOOT-SEED-SHORT-TEMP) #2514

Closed
enlight3d wants to merge 1 commit from upstream-pr/2514 into main
enlight3d commented 2026-11-27 23:45:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-27T23:45:47Z.


Claimed in the coordination issue as TEST-BOOT-SEED-SHORT-TEMP (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230385947). A fix for my own test from #2481.

What and why

tests/test_windows_boot_journal_seed.py (#2481) runs scripts/windows-boot/boot.ps1 -DryRun and compares the LEONIDA_PIPELINE_JOURNAL_SEED_DIR it prints with paths built from tempfile.mkdtemp(). On the GitHub Windows runner the temp folder is an 8.3 alias (C:\Users\RUNNER~1\...) while boot.ps1 prints the long names, so three cases compare two spellings of the same folder and fail. Main's CI run at d44285197 (job check) shows them: test_precompiled_journal_beside_the_runtime_is_the_seed, test_a_sibling_folder_is_not_an_overlap, test_a_relative_runtime_is_resolved_from_the_shell_location. My machine's temp folder has no 8.3 alias, which is why the PR passed here.

setUp now takes os.path.realpath of the temp folder, so the expected paths use the same final spelling boot.ps1 prints. Nothing else changes; boot.ps1 is untouched.

Tested

Windows 11, Windows PowerShell 5.1, Python 3.13.12:

  • With TMP and TEMP set to an 8.3 alias of a temp folder: 3 failures before (the same three as CI, same message shape), 17 of 17 OK after.
  • With the usual temp folder: 17 of 17 OK.
  • scripts/check_no_game_data.py on the file and git diff --check: clean.

check will still be red on this PR: main's run at d44285197 also fails four unrelated files (test_docs_cli_flags, test_docs_python_deps, test_docs_repo_paths, test_tool_stdout_encoding, the same ones in macos-python and stdlib-tests-linux), which this PR does not touch. Two independent reviews also tried boot.ps1 itself with short and long spellings of the runtime and cache folders mixed (16 combinations, Windows PowerShell 5.1): the seed and the overlap checks came out right in every one, so the mismatch was only the test's.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5534578727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2514). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-27T23:45:47Z. --- Claimed in the coordination issue as TEST-BOOT-SEED-SHORT-TEMP (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230385947). A fix for my own test from #2481. ### What and why `tests/test_windows_boot_journal_seed.py` (#2481) runs `scripts/windows-boot/boot.ps1 -DryRun` and compares the `LEONIDA_PIPELINE_JOURNAL_SEED_DIR` it prints with paths built from `tempfile.mkdtemp()`. On the GitHub Windows runner the temp folder is an 8.3 alias (`C:\Users\RUNNER~1\...`) while `boot.ps1` prints the long names, so three cases compare two spellings of the same folder and fail. Main's CI run at d44285197 (job `check`) shows them: `test_precompiled_journal_beside_the_runtime_is_the_seed`, `test_a_sibling_folder_is_not_an_overlap`, `test_a_relative_runtime_is_resolved_from_the_shell_location`. My machine's temp folder has no 8.3 alias, which is why the PR passed here. `setUp` now takes `os.path.realpath` of the temp folder, so the expected paths use the same final spelling `boot.ps1` prints. Nothing else changes; `boot.ps1` is untouched. ### Tested Windows 11, Windows PowerShell 5.1, Python 3.13.12: - With `TMP` and `TEMP` set to an 8.3 alias of a temp folder: 3 failures before (the same three as CI, same message shape), 17 of 17 OK after. - With the usual temp folder: 17 of 17 OK. - `scripts/check_no_game_data.py` on the file and `git diff --check`: clean. `check` will still be red on this PR: main's run at d44285197 also fails four unrelated files (`test_docs_cli_flags`, `test_docs_python_deps`, `test_docs_repo_paths`, `test_tool_stdout_encoding`, the same ones in `macos-python` and `stdlib-tests-linux`), which this PR does not touch. Two independent reviews also tried `boot.ps1` itself with short and long spellings of the runtime and cache folders mixed (16 combinations, Windows PowerShell 5.1): the seed and the overlap checks came out right in every one, so the mismatch was only the test's. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
zmasi commented 2026-11-28 03:02:35 +00:00 (Migrated from github.com)

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


#2514 | head 2af3c6cd28 (merged cleanly with main 02f71ccfe) | python -I tests/test_windows_boot_journal_seed.py (with 8.3 short TMP/TEMP) | red on main: FAILED (failures=3) in 17 tests under 8.3 short TMP/TEMP | green on PR+main: Ran 17 tests, OK (both 8.3 short TMP/TEMP and normal TMP/TEMP) | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed (single os.path.realpath(...) normalization on tempfile.mkdtemp in BootJournalSeedTest.setUp). Also verified on merged PR+main: python -I tests/test_text_write_line_endings.py (3/3 OK), git diff --check, and scripts/check_no_game_data.py tests/test_windows_boot_journal_seed.py (clean).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232756118 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2514#issuecomment-7232756118). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T03:02:35Z. --- #2514 | head 2af3c6cd28b2c3f45cedf0954235efa24d848cb8 (merged cleanly with main 02f71ccfe) | `python -I tests/test_windows_boot_journal_seed.py` (with `8.3` short `TMP`/`TEMP`) | red on main: FAILED (failures=3) in 17 tests under `8.3` short `TMP`/`TEMP` | green on PR+main: Ran 17 tests, OK (both `8.3` short `TMP`/`TEMP` and normal `TMP`/`TEMP`) | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed (single `os.path.realpath(...)` normalization on `tempfile.mkdtemp` in `BootJournalSeedTest.setUp`). Also verified on merged `PR+main`: `python -I tests/test_text_write_line_endings.py` (3/3 OK), `git diff --check`, and `scripts/check_no_game_data.py tests/test_windows_boot_journal_seed.py` (clean).
OreoFR commented 2026-11-28 22:03:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T22:03:37Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 2af3c6cd2
  • Test: python -I tests/test_windows_boot_journal_seed.py
  • Red on main: 17 OK
  • Green with the PR: 17 OK
  • Verdict: NO RED (this machine's TEMP is already a long name: the 8.3 short-name case is not exercised)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246467380 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2514#issuecomment-7246467380). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T22:03:37Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `2af3c6cd2` - Test: `python -I tests/test_windows_boot_journal_seed.py` - Red on main: 17 OK - Green with the PR: 17 OK - Verdict: NO RED (this machine's TEMP is already a long name: the 8.3 short-name case is not exercised) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
timbot103 commented 2026-11-29 04:28:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:28:52Z.

Review: COMMENTED


Static audit of head 2af3c6cd2 only. No builds, tests, or GPU runs were performed as part of this review.

In tests/test_windows_boot_journal_seed.py, resolving the shared temp root covers all three inferred-seed comparisons, including the sibling-folder and relative-runtime cases. On Windows, os.path.realpath() and Path.resolve() use the final path of the existing directory, which expands 8.3 names and resolves links, junctions, and substituted drives. The assertions separately use normcase for case-insensitive comparison. The class skips on macOS and Linux, where path resolution follows symlinks and preserves case in the path components. In scripts/windows-boot/boot.ps1, the final-path helper is used for overlap checks, and the inferred seed comes from the PowerShell provider's runtime path. The supplied Windows reruns report 17 passing cases with both an 8.3 temp alias and an ordinary temp path.

One test regression remains at tests/test_windows_boot_journal_seed.py:27. If an ASCII 8.3 temp alias expands to a name containing a character outside the console's OEM code page, the command-line and shell override cases now compare the Unicode path with a lossy stdout echo at lines 72 and 81. Please set the PowerShell console output encoding and Python's capture decoding to UTF-8 for both invocation paths.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101400575 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2514#pullrequestreview-6101400575). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:28:52Z. **Review:** COMMENTED --- Static audit of head `2af3c6cd2` only. No builds, tests, or GPU runs were performed as part of this review. In `tests/test_windows_boot_journal_seed.py`, resolving the shared temp root covers all three inferred-seed comparisons, including the sibling-folder and relative-runtime cases. On Windows, `os.path.realpath()` and `Path.resolve()` use the final path of the existing directory, which expands 8.3 names and resolves links, junctions, and substituted drives. The assertions separately use `normcase` for case-insensitive comparison. The class skips on macOS and Linux, where path resolution follows symlinks and preserves case in the path components. In `scripts/windows-boot/boot.ps1`, the final-path helper is used for overlap checks, and the inferred seed comes from the PowerShell provider's runtime path. The supplied Windows reruns report 17 passing cases with both an 8.3 temp alias and an ordinary temp path. One test regression remains at `tests/test_windows_boot_journal_seed.py:27`. If an ASCII 8.3 temp alias expands to a name containing a character outside the console's OEM code page, the command-line and shell override cases now compare the Unicode path with a lossy stdout echo at lines 72 and 81. Please set the PowerShell console output encoding and Python's capture decoding to UTF-8 for both invocation paths. AI-assisted.
aslan2142 commented 2026-12-01 11:37:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:37:24Z.


Closing as already landed on main: tests/test_windows_boot_journal_seed.py:36 on main already resolves the temp directory via os.path.realpath(tempfile.mkdtemp(...)). (AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7309896743 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2514#issuecomment-7309896743). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:37:24Z. --- Closing as already landed on main: tests/test_windows_boot_journal_seed.py:36 on main already resolves the temp directory via os.path.realpath(tempfile.mkdtemp(...)). *(AI-assisted review.)*

Pull request closed

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!2514
No description provided.