tests: the sgpr census folding-volume case mocks the helpers same_report_path calls #21

Manually merged
github merged 1 commit from gh-pr/21/head into gh-pr/21/base 2026-11-26 08:40:48 +00:00
Owner

@⁠wavehs on GitHub · 2026-11-24 01:53 UTC · original
wavehs:test-user-sgpr-folding-volume-mocks → main · +4 −2 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches tests/test_user_sgpr_census.py.

Depends on: none.

What and why

#6268 ("report_paths: resolve each path once in same_report_path") made same_report_path resolve both paths itself and call _resolved_key / _same_resolved_name directly, so that path_key and same_name_on_folding_volume are no longer on its way to the volume probe. It updated tests/test_report_paths.py to patch the private helpers, and tests/test_psin_names.py was updated with the same idiom, but tests/test_user_sgpr_census.py still patched the two public names.

On a case-insensitive volume the case still passed by accident, because the real key comparison folds INDEX.JSON onto index.json. On Linux the mocked probe is never called, the real key comparison and the real scratch-folder probe both say "different", and the tool writes the report:

tests/test_user_sgpr_census.py:486: FAILED tests/test_user_sgpr_census.py::test_json_report_refuses_to_overwrite_index[folding-volume-case] - Failed: DID NOT RAISE SystemExit
3 failed, 1861 passed, 14 skipped, 126 subtests passed in 42.53s

(from the translator-tests job on main; the other two are test_cf_diff, fixed by #7)

The folding-volume case now patches _resolved_key and _same_resolved_name, as test_report_paths.py:175 does; the rest of the parametrisation and the assertions are unchanged. Test file only; tools/report_paths.py is not touched. The product check is right — a real vfat/CIFS mount is caught by the existing scratch-folder probe.

Tested

main@9ec34cdff, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files. This host's APFS volume folds case, so the Linux key rules are emulated by setting report_paths.case_insensitive_volume = lambda p: False before the module is imported by the test run:

test file main@9ec34cdff, Linux rules emulated this commit, same run
test_json_report_refuses_to_overwrite_index 1 failed, 3 passed — Failed: DID NOT RAISE SystemExit in [folding-volume-case] 4 passed

On the unmodified macOS rules both trees pass, which is why this stayed invisible here. tests/test_user_sgpr_census.py, tests/test_psin_names.py and tests/test_report_paths.py together: 83 passed, 37 subtests passed. compileall clean, check_no_game_data.py clean.

Not run: Windows, real Linux, any GPU test, the translator suite.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: test-only.)
**@⁠wavehs** on GitHub · 2026-11-24 01:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/21) `wavehs:test-user-sgpr-folding-volume-mocks` → `main` · +4 −2 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches `tests/test_user_sgpr_census.py`. Depends on: none. ### What and why `#6268` ("report_paths: resolve each path once in same_report_path") made `same_report_path` resolve both paths itself and call `_resolved_key` / `_same_resolved_name` directly, so that `path_key` and `same_name_on_folding_volume` are no longer on its way to the volume probe. It updated `tests/test_report_paths.py` to patch the private helpers, and `tests/test_psin_names.py` was updated with the same idiom, but `tests/test_user_sgpr_census.py` still patched the two public names. On a case-insensitive volume the case still passed by accident, because the real key comparison folds `INDEX.JSON` onto `index.json`. On Linux the mocked probe is never called, the real key comparison and the real scratch-folder probe both say "different", and the tool writes the report: ``` tests/test_user_sgpr_census.py:486: FAILED tests/test_user_sgpr_census.py::test_json_report_refuses_to_overwrite_index[folding-volume-case] - Failed: DID NOT RAISE SystemExit 3 failed, 1861 passed, 14 skipped, 126 subtests passed in 42.53s ``` (from the `translator-tests` job on `main`; the other two are `test_cf_diff`, fixed by #7) The folding-volume case now patches `_resolved_key` and `_same_resolved_name`, as `test_report_paths.py:175` does; the rest of the parametrisation and the assertions are unchanged. Test file only; `tools/report_paths.py` is not touched. The product check is right — a real vfat/CIFS mount is caught by the existing scratch-folder probe. ### Tested `main@9ec34cdff`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files. This host's APFS volume folds case, so the Linux key rules are emulated by setting `report_paths.case_insensitive_volume = lambda p: False` before the module is imported by the test run: | test file | `main@9ec34cdff`, Linux rules emulated | this commit, same run | |---|---|---| | `test_json_report_refuses_to_overwrite_index` | `1 failed, 3 passed` — `Failed: DID NOT RAISE SystemExit` in `[folding-volume-case]` | `4 passed` | On the unmodified macOS rules both trees pass, which is why this stayed invisible here. `tests/test_user_sgpr_census.py`, `tests/test_psin_names.py` and `tests/test_report_paths.py` together: 83 passed, 37 subtests passed. `compileall` clean, `check_no_game_data.py` clean. Not run: Windows, real Linux, any GPU test, the translator suite. AI-assisted: yes. ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: test-only.)
#6268 made same_report_path resolve each path once and call _resolved_key and
_same_resolved_name directly, so patching the public path_key and
same_name_on_folding_volume no longer reaches the code under test. The
folding-volume case then only passed on a case-insensitive volume: on Linux
the real key comparison and the real volume probe both say "different", the
tool writes the report and the test fails with DID NOT RAISE SystemExit.

Patch the private helpers, as test_report_paths.py and test_psin_names.py do.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:40:46 +00:00
github manually merged commit 9ebd8cf868 into gh-pr/21/base 2026-11-26 08:40:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.