test(builder): the NUP cache checks no longer depend on the clone's work folder #2291

Merged
mooki000 merged 1 commit from test/make-game-cache-hermetic into main 2026-11-11 20:32:35 +00:00
mooki000 commented 2026-11-11 13:43:12 +00:00 (Migrated from github.com)

tests/test_make_game_cache.py fails in every clone that holds the play profile in its work/ folder, which is where
CONTRIBUTING.md tells developers to put it: three of its eleven checks stop on a clang process they did not expect.

Part of #2334.

What changed

  • tests/test_make_game_cache.py runs make_game.main() up to the lift with every process launch refused. On its way
    make_game copies the play profile (hot list, link order, PGO profile, image/chunks.txt) from <checkout>/work, and
    on Linux profile_readable() starts clang to see whether it can read the PGO profile: that launch failed
    test_changed_source_replaces_romfs_and_exefs_together, test_same_source_reuses_the_cache and
    test_update_replaces_clearable_scratch_exefs (Unexpected process launch).
  • The checks now run make_game as from an empty checkout inside their own temporary folder (make_game.ROOT patched,
    as test_make_game_ngx.py, test_ship_state_list.py and test_pipeline_states.py do), so nothing of the
    developer's work/ is read or copied.
  • They also give lift_key a fixed result. It hashes nx2/ with paths relative to the checkout, and with the checkout
    moved into the temporary folder os.path.relpath would refuse paths on another drive (Windows CI: the checkout on
    D:, the temporary folder on C:). The lift key is not what these checks are about; tests/test_lift_cache.py
    covers it.

Tests only; the builder is unchanged.

How it was tested

Linux (Arch, Python 3.12.16 and 3.14.8):

work/ of the clone main this change
the v2.1.0 play profile in it 3 of 11 fail 11 pass
empty 11 pass 11 pass

python -I -B tests/run_all.py on main 49f75dc8 with this change, the play profile in the clone's work/ (2026-11-11,
load 66 to 114): 360 passed, 4 failed, 10 skipped; tests/test_make_game_cache.py passes. Two of the failures are this
machine's and fail on main as well, each with a pull request of its own: tests/test_wayland_libdecor_hint.py (Clang
23) and tests/test_updater_asset_digest.py (only a .NET 10 SDK here). The other two failed under that load and pass
when run alone afterwards: nx2/test_depth_sample_types.py (its compiler was killed by SIGKILL) and
tests/test_display_pointer.py (its reader thread had made no read yet when the check ended; passed 3 of 3 alone).

Not tested

  • Windows: the cross-drive case is avoided by the fixed lift key, not run; CI's Windows job runs it.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 [email protected]

`tests/test_make_game_cache.py` fails in every clone that holds the play profile in its `work/` folder, which is where CONTRIBUTING.md tells developers to put it: three of its eleven checks stop on a clang process they did not expect. Part of #2334. ## What changed - `tests/test_make_game_cache.py` runs `make_game.main()` up to the lift with every process launch refused. On its way make_game copies the play profile (hot list, link order, PGO profile, `image/chunks.txt`) from `<checkout>/work`, and on Linux `profile_readable()` starts clang to see whether it can read the PGO profile: that launch failed `test_changed_source_replaces_romfs_and_exefs_together`, `test_same_source_reuses_the_cache` and `test_update_replaces_clearable_scratch_exefs` (`Unexpected process launch`). - The checks now run make_game as from an empty checkout inside their own temporary folder (`make_game.ROOT` patched, as `test_make_game_ngx.py`, `test_ship_state_list.py` and `test_pipeline_states.py` do), so nothing of the developer's `work/` is read or copied. - They also give `lift_key` a fixed result. It hashes `nx2/` with paths relative to the checkout, and with the checkout moved into the temporary folder `os.path.relpath` would refuse paths on another drive (Windows CI: the checkout on `D:`, the temporary folder on `C:`). The lift key is not what these checks are about; `tests/test_lift_cache.py` covers it. Tests only; the builder is unchanged. ## How it was tested Linux (Arch, Python 3.12.16 and 3.14.8): | `work/` of the clone | main | this change | |---|---|---| | the v2.1.0 play profile in it | 3 of 11 fail | 11 pass | | empty | 11 pass | 11 pass | `python -I -B tests/run_all.py` on main 49f75dc8 with this change, the play profile in the clone's `work/` (2026-11-11, load 66 to 114): 360 passed, 4 failed, 10 skipped; `tests/test_make_game_cache.py` passes. Two of the failures are this machine's and fail on main as well, each with a pull request of its own: `tests/test_wayland_libdecor_hint.py` (Clang 23) and `tests/test_updater_asset_digest.py` (only a .NET 10 SDK here). The other two failed under that load and pass when run alone afterwards: `nx2/test_depth_sample_types.py` (its compiler was killed by SIGKILL) and `tests/test_display_pointer.py` (its reader thread had made no read yet when the check ended; passed 3 of 3 alone). ## Not tested - Windows: the cross-drive case is avoided by the fixed lift key, not run; CI's Windows job runs it. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
mooki000 commented 2026-11-11 17:08:11 +00:00 (Migrated from github.com)

Rebased onto main b29967bf so the workflows run here: they had waited for an approval on the old head, and main's game-free tests are green again since #2380. The patch is unchanged (git range-diff: the commit is equal), and its test passes on the new base.

Rebased onto main `b29967bf` so the workflows run here: they had waited for an approval on the old head, and main's game-free tests are green again since #2380. The patch is unchanged (`git range-diff`: the commit is equal), and its test passes on the new base.
Joey-Magnus (Migrated from github.com) approved these changes 2026-11-11 20:07:48 +00:00
Joey-Magnus (Migrated from github.com) left a comment

Looks good. Pointing make_game.ROOT at an empty checkout inside the test's temp folder is the same isolation test_make_game_ngx.py and others already use, and it removes the dependency on whatever is in the clone's work/. Since lift_key hashes HERE (the real nx2/) relative to ROOT, faking ROOT alone would break relpath on Windows across drives. Stubbing lift_key is the right call, and tests/test_lift_cache.py still covers the key itself. I ran tests/test_make_game_cache.py at the PR's head on Linux, and it passes. CI shows it passing on both Windows parts and both Ubuntu parts.

About the two red jobs, so nobody holds the PR for them:

  • Python source checks (windows-2022, part 1/2) failed in tests/test_native_astc_texture_count.py (scanf deprecated under -Werror with the MSVC CRT). This PR doesn't touch that test, and #2397 (d2073609) has since fixed it on main. A merge or rebase onto current main, or just a rerun after merge, will clear it.
  • appimage failed on TimeoutError: [Errno 110] Connection timed out while fetching dependencies. That's network flakiness, so a rerun should do.

No changes needed from my side.

Looks good. Pointing `make_game.ROOT` at an empty checkout inside the test's temp folder is the same isolation `test_make_game_ngx.py` and others already use, and it removes the dependency on whatever is in the clone's `work/`. Since `lift_key` hashes `HERE` (the real `nx2/`) relative to `ROOT`, faking `ROOT` alone would break `relpath` on Windows across drives. Stubbing `lift_key` is the right call, and `tests/test_lift_cache.py` still covers the key itself. I ran `tests/test_make_game_cache.py` at the PR's head on Linux, and it passes. CI shows it passing on both Windows parts and both Ubuntu parts. About the two red jobs, so nobody holds the PR for them: - **Python source checks (windows-2022, part 1/2)** failed in `tests/test_native_astc_texture_count.py` (`scanf` deprecated under `-Werror` with the MSVC CRT). This PR doesn't touch that test, and #2397 (`d2073609`) has since fixed it on main. A merge or rebase onto current main, or just a rerun after merge, will clear it. - **appimage** failed on `TimeoutError: [Errno 110] Connection timed out` while fetching dependencies. That's network flakiness, so a rerun should do. No changes needed from my side.
mooki000 commented 2026-11-11 21:26:08 +00:00 (Migrated from github.com)

Thanks for the Linux run and CI check. The isolated-fixture fix is now merged as 4b5266a0.

Thanks for the Linux run and CI check. The isolated-fixture fix is now merged as `4b5266a0`.
Commenting is not possible because the repository is archived.
No description provided.