[PR #21] [MERGED] tests: the sgpr census folding-volume case mocks the helpers same_report_path calls #76

Closed
opened 2026-11-26 20:16:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/21
Author: @wavehs
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: test-user-sgpr-folding-volume-mocks


📝 Commits (1)

  • 9ebd8cf tests: the sgpr census folding-volume case mocks the helpers same_report_path calls

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 tests/test_user_sgpr_census.py (+4 -2)

📄 Description

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.)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/21 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `test-user-sgpr-folding-volume-mocks` --- ### 📝 Commits (1) - [`9ebd8cf`](https://github.com/ubiquitarianism/leonida/commit/9ebd8cf868bcabb9829c05e463914850fc29ac85) tests: the sgpr census folding-volume case mocks the helpers same_report_path calls ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_user_sgpr_census.py` (+4 -2) </details> ### 📄 Description 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.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:43 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
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
starred/leonida#76
No description provided.