Pin sys.platform=win32 in legacy-Tauri-extras test#30
Merged
cryptopoly merged 1 commit intomainfrom May 2, 2026
Merged
Conversation
test_legacy_tauri_app_data_extras_are_import_candidates patched LOCALAPPDATA but not sys.platform. _user_data_base() in backend_service/runtime_paths.py only reads LOCALAPPDATA on sys.platform == 'win32'; on macOS dev boxes and the ubuntu-latest CI runner that branch is skipped, so the helper looks in the host's real ~/Library/Application Support or ~/.local/share rather than the tempdir the test mkdir'd into. The assertion then fails because the legacy candidate path resolved against the real user-data base doesn't match the one the test created. Wrap the helper call with mock.patch.object(runtime_paths.sys, 'platform', 'win32') so the Windows branch is exercised regardless of host OS. Same shape as the existing env-var patch. Surfaced by the run-25251848663 failure on main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_setup_routes.py::RuntimePathTests::test_legacy_tauri_app_data_extras_are_import_candidateshas been failing on the ubuntu-latest CI runner since the test landed in 5be4964:Root cause:
_user_data_base()inbackend_service/runtime_paths.pyonly readsLOCALAPPDATAonsys.platform == 'win32'. The test patched the env var but not the platform, so on macOS dev boxes and Linux CI runners the helper looked in the host's real~/Library/Application Support/~/.local/shareinstead of the tempdir the testmkdir'd into.Wrap the helper call with
mock.patch.object(runtime_paths.sys, 'platform', 'win32')so the Windows branch is exercised regardless of host OS.Test plan
.venv/bin/python -m pytest tests/test_setup_routes.py::RuntimePathTests -v— 2/2 pass.venv/bin/python -m pytest tests/test_setup_routes.py -q— 60/60 pass