Skip to content

Pin sys.platform=win32 in legacy-Tauri-extras test#30

Merged
cryptopoly merged 1 commit intomainfrom
fix/runtime-paths-test-platform
May 2, 2026
Merged

Pin sys.platform=win32 in legacy-Tauri-extras test#30
cryptopoly merged 1 commit intomainfrom
fix/runtime-paths-test-platform

Conversation

@cryptopoly
Copy link
Copy Markdown
Owner

@cryptopoly cryptopoly commented May 2, 2026

Summary

test_setup_routes.py::RuntimePathTests::test_legacy_tauri_app_data_extras_are_import_candidates has been failing on the ubuntu-latest CI runner since the test landed in 5be4964:

AssertionError: PosixPath('/tmp/tmp49t1dt_e/com.chaosengineai.desktop/extras/cp312/site-packages') not found in []

Root cause: _user_data_base() in backend_service/runtime_paths.py only reads LOCALAPPDATA on sys.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/share instead of the tempdir the test mkdir'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
  • CI on Linux — confirm pass once this PR merges

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.
@cryptopoly cryptopoly merged commit bc5c3b0 into main May 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant