Repository navigation
Conversation
…sh From PATH (#2508) ## Summary This is the first step of #2488. It covers the two shared causes behind most of the suite's Windows failures. The rest of #2488 stays open for follow-up pull requests. - **Symlink fixtures.** Windows refuses `os.symlink` with WinError 1314 unless Developer Mode is on or the process is elevated. The new `tests/host_capability.py` probes this once. The 16 tests that build a symlink fixture now skip there with that reason, and two older ad-hoc catches use the same helper. The two `test_build_dist` tests that mix symlink and plain cases keep running their plain cases on Windows. - **A bare `bash` resolving to WSL.** A bare `"bash"` passed to `subprocess` on Windows is resolved by CreateProcess, which searches System32 before PATH. That finds the WSL launcher, which re-parses the script through a second shell. This caused the `read -a` errors and most of the `test_prose_lint`, `test_release_guards` and `test_publish_plan` failures. The tests now run the first `bash.exe` on PATH that is neither the launcher nor a `.cmd`/`.bat` shim. Where there is none, as from a PowerShell PATH, they skip with a reason saying to run the suite from Git Bash. - The receipt case in `test_local_review` now quotes its script path, in POSIX form, inside its `bash -c` string, since bash consumed the Windows path's backslashes. Linux CI is unaffected. There, `can_symlink()` is true, and `bash_path()` returns the same binary `shutil.which("bash")` did. ## Measured on a Windows 11 host, from Git Bash | | Before | After | | --- | --- | --- | | Failures | 47 | 15 | | Errors | 26 | 10 | | Skipped | 82 | 96 | From PowerShell, the bash-driven modules (`test_configure_*`, `test_prose_lint`, `test_release_guards`, `test_publish_plan`) now report `OK` with skips, where they failed before. ## Still open under #2488 - **`test_local_review`, 15.** These include two `ReceiptCase` tests that exit 120 on a closed pipe. That is a `local_review.py` Windows defect the WSL launcher had been masking by running the case under Linux. - **`test_spec_validate`, `test_host_gate`, `test_docker_lint`, 7.** These come from path-separator and output assumptions. - **`test_release_guards`, 1 test.** It fails under winget's jq 1.8.2, which rejects `\S`. Refs #2488 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2515 +/- ##
=======================================
Coverage 58.50% 58.50%
=======================================
Files 16 16
Lines 8066 8066
=======================================
Hits 4719 4719
Misses 3347 3347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified, and approval readiness is unanimously confirmed.
0 open findings
What changed in this PR
Promotes develop to main with Windows compatibility improvements for the test suite.
Changes:
- Detects usable Bash and symlink support.
- Skips unsupported symlink fixtures cleanly.
- Fixes Windows PATH handling and preserves failfast coverage.
| File | Description |
|---|---|
tests/test_skills_install.py |
Guards symlink fixtures |
tests/test_release_guards.py |
Uses selected Bash |
tests/test_publish_plan.py |
Uses selected Bash |
tests/test_prose_lint.py |
Uses selected Bash |
tests/test_local_review.py |
Guards symlinks and Bash execution |
tests/test_host_capability.py |
Tests Windows Bash selection |
tests/test_docker_lint.py |
Guards symlink fixtures |
tests/test_configure_usage.py |
Fixes Windows PATH handling |
tests/test_configure_settings_live.py |
Uses selected Bash |
tests/test_configure_ruleset_id.py |
Uses selected Bash |
tests/test_configure_project.py |
Uses selected Bash |
tests/test_configure_environments.py |
Uses selected Bash |
tests/test_configure_archived.py |
Fixes Windows PATH handling |
tests/test_carry.py |
Guards symlink fixtures |
tests/test_canonical_review.py |
Guards symlink fixtures |
tests/test_build_dist.py |
Handles unavailable symlink fixtures |
tests/host_capability.py |
Provides shared capability helpers |
🧠 Review effort: Lite
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Summary
Promotes one change from
develop:os.symlinkwithout Developer Mode or elevation. The newtests/host_capability.pyprobes this once, and the tests that build a symlink fixture skip there with that reason. The twotest_build_disttests that mix symlink and plain cases keep their plain cases, and take the link case last so that a failfast run still reaches every plain case.bash. A barebashpassed tosubprocesson Windows resolves to System32's WSL launcher, which re-parses the script. The tests now run the firstbash.exeon PATH that is neither the launcher nor a shim. Off Windows they useshutil.which("bash")as before.configuretests now join their stub directory onto PATH withos.pathsep, since Git Bash's PATH conversion fused a:-joined stub with the first inherited entry. Thejqcarriage-return test resolves its stub directory in bash, since a drive-letter path split at its colon.tests/test_host_capability.pycovers the Windows selection on any host, Linux CI included.Refs #2488, which stays open for the remaining Windows failures.
Verification
jqstub test), and a singular overview variant noted on Recognize Copilot's Collapsible "N Open Findings" Overview Block in pr_review.py #2480.🤖 Generated with Claude Code