fix: make the remaining test suite pass on Windows#335
Open
ShreyanshVaibhaw wants to merge 1 commit into
Open
Conversation
Follow-up to huggingface#326, which fixed test_coding_session.py. The rest of the suite had 9 more Windows failures in three categories: 1. Bash-specific tests (test_coding_tools.py): shell_command_prefix routing and job control (sleep & wait) only apply on POSIX, so the three tests exercising them are now skipif win32, matching the markers added to test_coding_session.py in huggingface#326. 2. POSIX permission bits (test_credentials.py): chmod(0o600) cannot be asserted via S_IMODE on Windows filesystems, so the assertion is now guarded to POSIX. 3. Path-separator assumptions (test_system_prompt.py, test_tui_app.py): build_system_prompt normalizes the cwd to forward slashes on every platform while the test expected the native form; four TUI tests expected the opposite - hardcoded forward-slash paths where the product renders str(Path(...)) with native separators. Expectations now derive from the same formatting the product uses.
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
Follow-up to #326 (merged), which fixed
tests/test_coding_session.pyon Windows. Running the rest of the suite on Windows surfaced 9 more failures on unmodifiedmain, in three categories. This PR fixes all of them; the full suite on Windows now reports 730 passed, 6 skipped, 0 failed. Test-only change - no product code touched, POSIX runs unaffected.Root causes and fixes
1. Bash-specific tests (3 tests,
test_coding_tools.py)test_create_coding_tools_applies_shell_command_prefix,test_bash_tool_applies_opt_in_shell_command_prefix, andtest_bash_tool_cancellation_kills_shell_childrenrely on bash behavior:shell_command_prefixonly routes through bash on POSIX (os.name == "posix"branch increate_bash_tool), andsleep 1 & waitis bash job control. Markedskipif(sys.platform == "win32")with arequires_posix_shellmarker, matching the pattern accepted in #326.2. POSIX permission bits (1 test,
test_credentials.py)test_file_credential_store_round_trips_and_sets_private_permissionsassertsS_IMODE(...) == 0o600afterchmod(0o600), but Windows filesystems do not honor those bits (stat reports 0o666). The round-trip assertions still run everywhere; only the permission-bit check is now gated to POSIX.3. Path-separator assumptions (5 tests,
test_system_prompt.py+test_tui_app.py)Two opposite mismatches:
build_system_promptdeliberately normalizes the cwd to forward slashes on every platform (_format_path), but the test expected the nativestr(tmp_path)form. The expectation now applies the same normalization./workspace/project,.agents/AGENTS.md, export/resume paths) where the product rendersstr(Path(...))with native separators. Expectations now derive fromPathso they are correct on every platform.Notes
HOME-only monkeypatch pattern flagged in Test suite fails on Windows and mutates the developer's real ~/.tau settings #325 fortest_cli.py/test_tui_app.pyno longer exists on currentmain, so there was nothing to extend there.test_streaming_code_block_hides_horizontal_scrollbar_until_finalizedfailed once during the first full-suite run but passed 5 consecutive subsequent runs (isolated and full-file); it appears to be a rare timing flake unrelated to this change, so it is not touched here.Validation
test_coding_tools.py,test_credentials.py,test_system_prompt.py,test_tui_app.py(Windows 11, Python 3.12.7, currentmain).uv run pytest tests/-> 730 passed, 6 skipped (all POSIX-only, explicitly marked), 0 failed.ruff check tests/clean.🤖 Generated with Claude Code