Repository navigation
fix: make the test suite pass on Windows - #70
Open
maceorichards wants to merge 1 commit into
Open
maceorichards wants to merge 1 commit into
maceorichards wants to merge 1 commit into
Conversation
Tests now run sync.sh through Git Bash, point both HOME and USERPROFILE at the sandbox (Python on Windows reads USERPROFILE), fall back to a directory junction for the vendor link, clear read-only flags when cleaning up, read output as UTF-8, and wrap the fake CLIs in .exe launchers. Tests that need symlinks or read-only folders skip on Windows with a reason. sync.py fixes: - tilde() shows paths under home as ~/... with forward slashes on Windows - removing the devflow section from a CRLF file no longer leaves a blank line Refs #51. Fixes #67, #68, #69. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The unit suite now passes on Windows: 405 tests, OK (29 skipped). Before this change it had 55 failures and 130 errors. The real home folder stays unchanged across runs.
Test harness (
tests/harness.py)sync.shthrough Git Bash (script_argv), since Windows can't run shebang scripts.set_home()points bothHOMEandUSERPROFILEat the sandbox. Python on Windows readsUSERPROFILE, so without this the tests wrote into the real profile (Tests write to the real user profile on Windows: HOME doesn't redirect ~ #67).link_dir()falls back to a directory junction when symlinks aren't allowed.rmtree()clears read-only flags (git object files) on cleanup.install_python_command()wraps the fake CLIs in a pip/distlib.exelauncher on Windows.requires_symlinks(13 tests; Windows needs Developer Mode or admin) andrequires_posix_permissions(16 tests; Windows can't make folders read-only).lib/sync.pytilde()shows paths under home as~/...with forward slashes on Windows (Paths under home aren't shown as ~/... on Windows #68).Other test fixes
fake_cli.pystrips.exefrom its program name.Not verified
windows-latestin the CI unit matrix; that's not in this PR.Refs #51. Fixes #67, #68, #69.
🤖 Generated with Claude Code