Skip to content

Promote develop to main: Skip or Run the Test Suite Cleanly on Windows - #2515

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 8, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes one change from develop:

  • Skip a Symlink Test Where Windows Withholds the Privilege, and Run bash From PATH #2508: the unittest suite skips or runs cleanly on Windows for its two widest failure classes.
    • Symlink fixtures. Windows refuses os.symlink without Developer Mode or elevation. The new tests/host_capability.py probes this once, and the tests that build a symlink fixture skip there with that reason. The two test_build_dist tests 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.
    • A bare bash. A bare bash passed to subprocess on Windows resolves to System32's WSL launcher, which re-parses the script. The tests now run the first bash.exe on PATH that is neither the launcher nor a shim. Off Windows they use shutil.which("bash") as before.
    • Two configure tests now join their stub directory onto PATH with os.pathsep, since Git Bash's PATH conversion fused a :-joined stub with the first inherited entry. The jq carriage-return test resolves its stub directory in bash, since a drive-letter path split at its colon.
    • tests/test_host_capability.py covers the Windows selection on any host, Linux CI included.

Refs #2488, which stays open for the remaining Windows failures.

Verification

🤖 Generated with Claude Code

…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]>
Copilot AI lite review requested due to automatic review settings October 8, 2026 03:16
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d76906c3-8125-473f-a695-4ea001e61163
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.50%. Comparing base (e3d43de) to head (8bdfa25).
⚠️ Report is 326 commits behind head on main.

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           
Flag Coverage Δ
python-3.13 58.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI 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.

🟢 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.

@ptr727
ptr727 merged commit adab03b into main Oct 8, 2026
13 checks passed
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