Skip to content

fix(tests): improve Windows cross-platform test compatibility#2558

Open
panandicoding wants to merge 1 commit into
MoonshotAI:mainfrom
panandicoding:fix/windows-test-compat
Open

fix(tests): improve Windows cross-platform test compatibility#2558
panandicoding wants to merge 1 commit into
MoonshotAI:mainfrom
panandicoding:fix/windows-test-compat

Conversation

@panandicoding

@panandicoding panandicoding commented Jul 25, 2026

Copy link
Copy Markdown

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:

  1. test_background_tools.py: Path.write_text() without newline="" converts \n to \r\n on Windows, causing last_seen_output_size assertions to fail (28 bytes vs expected 26 bytes).

  2. tests/e2e/: Unconditional import fcntl at module level causes ModuleNotFoundError during test collection on Windows, since fcntl, termios, and pty are Unix-only modules.

Changes

  • Added newline="" to write_text() calls in test helpers _write_task() and _write_agent_task() to ensure consistent byte lengths across platforms.
  • Created tests/e2e/conftest.py with collect_ignore_glob to 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

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open in Devin Review

- Use newline='' in write_text() to prevent CRLF conversion on Windows

- Skip PTY-based e2e tests on Windows (fcntl/termios unavailable)

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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