fix(tests): improve Windows cross-platform test compatibility#2558
Open
panandicoding wants to merge 1 commit into
Open
fix(tests): improve Windows cross-platform test compatibility#2558panandicoding wants to merge 1 commit into
panandicoding wants to merge 1 commit into
Conversation
- Use newline='' in write_text() to prevent CRLF conversion on Windows - Skip PTY-based e2e tests on Windows (fcntl/termios unavailable)
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.
Related Issue
N/A (small fix < 100 lines; no prior issue required per CONTRIBUTING.md)
Description
Two Windows cross-platform issues in the test suite:
test_background_tools.py:Path.write_text()withoutnewline=""converts\nto\r\non Windows, causinglast_seen_output_sizeassertions to fail (28 bytes vs expected 26 bytes).tests/e2e/: Unconditionalimport fcntlat module level causesModuleNotFoundErrorduring test collection on Windows, sincefcntl,termios, andptyare Unix-only modules.Changes
newline=""towrite_text()calls in test helpers_write_task()and_write_agent_task()to ensure consistent byte lengths across platforms.tests/e2e/conftest.pywithcollect_ignore_globto skip PTY-based e2e tests on Windows.Note: CI currently only runs tests on Ubuntu, so these issues were not caught previously. These fixes enable local development and testing on Windows without false failures.
Checklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.