Skip to content

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

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
mooki000:test/make-game-cache-hermetic
Nov 11, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
mooki000:test/make-game-cache-hermetic

Conversation

@mooki000

@mooki000 mooki000 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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 49f75dc 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 noreply@anthropic.com

…ork folder

tests/test_make_game_cache.py runs make_game.main() up to the lift with every process launch refused. make_game copies
the play profile (hot list, link order, PGO profile, chunk boundaries) from <checkout>/work, and on Linux probes the
PGO profile with clang: in a clone that holds the profile there, as CONTRIBUTING.md has developers put it, three of
the eleven checks failed on that launch, and passed again with the profile moved aside.

The checks now run make_game as from an empty checkout inside their temporary folder (make_game.ROOT patched, as
test_make_game_ngx.py and test_ship_state_list.py do), and with a fixed lift key: the key hashes nx2/ relative to the
checkout, which os.path.relpath refuses across drives on Windows, and it is not what these checks are about.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mooki000

Copy link
Copy Markdown
Contributor Author

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.

@mooki000
mooki000 force-pushed the test/make-game-cache-hermetic branch from 39fab55 to 8fbeac9 Compare November 11, 2026 17:08

@Joey-Magnus Joey-Magnus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hckrman101
hckrman101 merged commit 4b5266a into NotRexed:main Nov 11, 2026
10 of 12 checks passed
@mooki000

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants