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

Merged
wavehs merged 1 commit from upstream-pr/21 into main 2026-11-24 02:26:15 +00:00
wavehs commented 2026-11-24 01:53:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T01:53:54Z.


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.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464580381 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/21). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T01:53:54Z. --- 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.)
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!21
No description provided.