fix(tests): the launcher's tests follow version folders and builder protocol 2 #358

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/tests-after-protocol-2 into main 2026-11-29 01:36:30 +00:00
Owner

After #352 (versions are their folders) and #353 (builder protocol 2), cargo test --locked on main had 24 failures and the translations check failed. Every failure was a stale test: each expected the old versions.json scan or the old builder command line. No launcher code changes. No test was loosened: each fixture now sets up what the new code needs, and the two assertions that changed now check the new behaviour.

What was stale

From #352: a folder is a version only once it has version.json (16 tests)

  • Fixtures made a version folder with a builder and builds/default but no record, so the scan skipped it ("Pick your game files…", "does not belong to an installed Longshot version", wrong storage group, no reuse). New test helpers fake_listed_version / describe_fake_version (src/game/mod.rs) write the record a completed build writes. Used in jobs, actions, library, storage, mods, wizard (a discovered copy carries its record), reuse and romfs.
  • prune::a_folder_an_earlier_launcher_retired_keeps_its_build: the rewritten test dropped the players::initialize the old one had, so list_profiles failed on a missing profiles/. It initializes the home again.
  • registry::migration_keeps_ids… asserted that the retired folder's build was kept. #352's commit 4 removes retired folders that hold no saves or settings during the migration, and the code does exactly that. The test now asserts that the folder is gone (its path stays in previousFolders for Steam retargeting).

From #353: protocol 2 (8 tests)

  • Every builder command first asks info for protocol: 2. The fake builders in mods (and its preflight tests), wizard update, reuse, romfs (it answered the old --help) and the releases fetch base now answer info. The mods fake builder reads the protocol 2 mod --profile <p> --output json line, with no --cache.
  • Steam tile: the test's shortcuts.vdf writer ended only the shortcuts map. Steam ends the root map too (08 08), and the new strict VDF reader rightly refuses a library cut short. The writer is fixed.
  • Linux home and portable: these check the mod command's environment, and they now run with a builder file taken as protocol 2 (builder_cli::assume_speaks, test only). The Linux home test asserted LONGSHOT_DATA, which #353 removed on purpose. It now asserts the variable is absent, as process.rs's own test does.

Translations: ko, pl and zh-Hant each lacked #353's two Settings strings.

Checklist

  • cargo test --locked (via tests/test_launcher_core.py), scripts/translations.py, cargo clippy --locked --workspace --all-targets -- -D warnings and cargo fmt --check pass on Linux.
  • Tests only plus catalog strings, so nothing changes in the running launcher and no launcher run is needed.
  • Windows: not run here. The changes are in unix-only or platform-neutral tests.

🤖 Generated with Claude Code

After [#352](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/352) (versions are their folders) and [#353](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/353) (builder protocol 2), `cargo test --locked` on main had 24 failures and the translations check failed. Every failure was a stale test: each expected the old versions.json scan or the old builder command line. No launcher code changes. No test was loosened: each fixture now sets up what the new code needs, and the two assertions that changed now check the new behaviour. ## What was stale **From #352: a folder is a version only once it has `version.json`** (16 tests) - Fixtures made a version folder with a builder and `builds/default` but no record, so the scan skipped it ("Pick your game files…", "does not belong to an installed Longshot version", wrong storage group, no reuse). New test helpers `fake_listed_version` / `describe_fake_version` (src/game/mod.rs) write the record a completed build writes. Used in jobs, actions, library, storage, mods, wizard (a discovered copy carries its record), reuse and romfs. - `prune::a_folder_an_earlier_launcher_retired_keeps_its_build`: the rewritten test dropped the `players::initialize` the old one had, so `list_profiles` failed on a missing `profiles/`. It initializes the home again. - `registry::migration_keeps_ids…` asserted that the retired folder's build was kept. #352's commit 4 removes retired folders that hold no saves or settings during the migration, and the code does exactly that. The test now asserts that the folder is gone (its path stays in `previousFolders` for Steam retargeting). **From #353: protocol 2** (8 tests) - Every builder command first asks `info` for `protocol: 2`. The fake builders in mods (and its preflight tests), wizard update, reuse, romfs (it answered the old `--help`) and the releases fetch base now answer `info`. The mods fake builder reads the protocol 2 `mod --profile <p> --output json` line, with no `--cache`. - Steam tile: the test's `shortcuts.vdf` writer ended only the `shortcuts` map. Steam ends the root map too (`08 08`), and the new strict VDF reader rightly refuses a library cut short. The writer is fixed. - Linux home and portable: these check the mod command's environment, and they now run with a builder file taken as protocol 2 (`builder_cli::assume_speaks`, test only). The Linux home test asserted `LONGSHOT_DATA`, which #353 removed on purpose. It now asserts the variable is absent, as process.rs's own test does. **Translations**: ko, pl and zh-Hant each lacked #353's two Settings strings. ## Checklist - [x] `cargo test --locked` (via `tests/test_launcher_core.py`), `scripts/translations.py`, `cargo clippy --locked --workspace --all-targets -- -D warnings` and `cargo fmt --check` pass on Linux. - [x] Tests only plus catalog strings, so nothing changes in the running launcher and no launcher run is needed. - [ ] Windows: not run here. The changes are in unix-only or platform-neutral tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(tests): the launcher's tests follow version folders and builder protocol 2
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
PR title / Conventional Commit title (pull_request) Successful in 11s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 12s
CI / Release packages and stable upgrades (pull_request) Failing after 1m0s
CI / Rust formatting, lint and tests (pull_request) Successful in 13m7s
a278caed3d
After #352 and #353, 24 tests expected the old versions.json scan or the old
builder command line. Fixtures now write each version's record and answer the
builder's info with protocol 2; the Steam fixture ends its root map; the home
test asserts LONGSHOT_DATA is gone; the migration test asserts the retired
folder is removed. ko, pl and zh-Hant get #353's two strings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean force-pushed fix/tests-after-protocol-2 from a278caed3d
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
PR title / Conventional Commit title (pull_request) Successful in 11s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 12s
CI / Release packages and stable upgrades (pull_request) Failing after 1m0s
CI / Rust formatting, lint and tests (pull_request) Successful in 13m7s
to 34c809d627
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 11s
PR title / Conventional Commit title (pull_request) Successful in 6s
CI / Release packages and stable upgrades (pull_request) Failing after 1m2s
CI / Rust formatting, lint and tests (pull_request) Successful in 11m37s
2026-11-29 01:33:33 +00:00
Compare
HumanBean changed title from WIP: fix(tests): the launcher's tests follow version folders and builder protocol 2 to fix(tests): the launcher's tests follow version folders and builder protocol 2 2026-11-29 01:36:25 +00:00
HumanBean deleted branch fix/tests-after-protocol-2 2026-11-29 01:36:30 +00:00
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/LongshotLauncher!358
No description provided.