Skip to content

Make the test suite pass on Windows - #186

Open
darthmolen wants to merge 3 commits into
obra:mainfrom
darthmolen:windows-dev-fixes
Open

darthmolen wants to merge 3 commits into
obra:mainfrom
darthmolen:windows-dev-fixes

Conversation

@darthmolen

Copy link
Copy Markdown

Summary

Three small fixes that make the test suite pass on Windows, so a local checkout there matches CI.

  • .gitattributes forces LF checkouts. With core.autocrlf=true, the default for Git on Windows, the working copy is CRLF while npm run build writes LF. Every rebuild then marks every file in dist/ as modified. The index is already all LF, so nothing is renormalized.
  • parseConversationFile uses path.dirname. It split the path on /, so a Windows path with \ separators always produced project 'unknown'. This fixes the two parser.test.ts failures on Windows.
  • Two POSIX-only tests are skipped on Windows, following the existing describe.skipIf pattern. Both still run on Linux and macOS:
    • The file-lock EACCES test uses chmod to make a directory unwritable, which Windows ignores.
    • The wrapper's SIGTERM orphan test runs an extensionless shebang stub as npm, which Windows can't execute from PATH. Windows also has no catchable SIGTERM.

Test plan

  • npm test on Windows 11: 342 passed, 8 skipped, 0 failed (previously 4 failures).
  • CI on Ubuntu (skips don't apply there).

🤖 Generated with Claude Code

darthmolen and others added 3 commits October 5, 2026 09:17
With core.autocrlf=true on Windows, the working copy is CRLF while the
build writes LF, so every rebuilt dist/ file showed as modified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parseConversationFile split the path on '/', so a Windows path with '\'
separators always produced project 'unknown'. path.dirname uses the
platform's separators.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file-lock EACCES test makes a directory unwritable with chmod, which
Windows ignores. The wrapper SIGTERM test runs an extensionless shebang
stub as `npm`, which Windows can't execute from PATH, and Windows has no
catchable SIGTERM. Both still run on Linux and macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused changes correctly address Windows incompatibilities while retaining coverage on supported platforms.

Review effort: Balanced
Findings: None

What changed in this PR

Makes path handling and platform-specific tests compatible with Windows while preserving generated output consistency.

Changes:

  • Uses platform-aware project path extraction.
  • Skips unsupported POSIX-specific tests on Windows.
  • Enforces LF checkouts across platforms.
File Description
.gitattributes Enforces LF line endings.
src/​parser.ts Uses platform-aware path utilities.
dist/​parser.js Updates generated parser output.
test/​file-lock.test.ts Skips the chmod test on Windows.
test/​mcp-install-runner.test.ts Skips the SIGTERM test on Windows.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants