test(e2e): enable 16 of the 21 Windows-skipped scenarios under Git Bash - #116
Merged
Conversation
Scenarios on the Git Bash leg straddle two path worlds: the interpreter speaks /c/..., the native wt.exe speaks C:\.... Bash converts POSIX-looking arguments when spawning a native binary but leaves environment variables alone, so a scenario handing wt a path via the environment needs the native form while its own assertions need the POSIX one. Export every base path in both forms. Off Windows the two coincide, so a scenario written against them stays portable across all legs. Refs #115
skip_os: [windows] here was standing in for a shell constraint, not an OS one: the steps use bash-only inline env syntax, which fish and PowerShell cannot parse but Git Bash can. skip_shells already excluded those three. wt resolves the home directory from %USERPROFILE% on Windows and $HOME elsewhere, so set both — the Windows one in native form. Refs #115
The skip reason was already recorded as a PowerShell limitation — an empty env var reads as unset there — so express it as skip_shells and let the Git Bash leg, which has no such limitation, run it. Refs #115
`test -d` is a POSIX-shell constraint rather than an OS one, so swap the marker for skip_shells. The assertion reads the worktree root back from the shell, which needs the POSIX form of the path wt was given. Refs #115
Both recorded reasons — `test -d` and PowerShell exit-code handling — are shell constraints, not OS ones. Assert the removed directory through the POSIX form of the worktree root, which is what the shell can stat. Refs #115
These built their own worktree root as $REPO_DIR/../worktrees and handed it to wt through the environment — the one direction bash does not convert, so under Git Bash wt would receive a POSIX path it cannot resolve. That root is the same directory the harness already exports as WORKTREE_ROOT, in wt's own path world, so use it directly and assert against its POSIX form. Refs #115
Same environment-variable crossing as the migrate scenarios: drop the hand-built WORKTREE_ROOT in favour of the one the harness exports. The remaining constraint is that the step names POSIX-generator variables, so record it as skip_shells. Refs #115
wt spawns hook commands itself, via `cmd /c` on Windows (runHooks) — so the calling shell is irrelevant to them. Bodies referencing $WT_PATH or $WT_MAIN, or calling POSIX utilities, genuinely cannot run there; they keep skip_os but now say why. The four whose body is a bare `false` or `echo` are only held back by the POSIX syntax of the surrounding steps, so they move to skip_shells and gain the Git Bash leg. WT_CONFIG reaches wt through the environment, which bash does not path-convert, so pass it in native form. Refs #115
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
==========================================
- Coverage 36.81% 36.80% -0.02%
==========================================
Files 27 27
Lines 3102 3111 +9
==========================================
+ Hits 1142 1145 +3
- Misses 1875 1880 +5
- Partials 85 86 +1
🚀 New features to boost your workflow:
|
This was referenced Aug 10, 2026
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.
Closes #115.
skip_os: [windows]was carrying two different meanings. Separating them:Shell constraints, not OS ones — the step body uses POSIX shell syntax
(
test -d, inlineVAR=x cmd, empty env vars) that PowerShell can't parsebut Git Bash can. These become
skip_shells: [powershell, pwsh]:init(4),separator(1),format-json(1),cleanup(1),remove(2).Path-world crossings — bash converts POSIX-looking arguments when it
spawns a native binary, but not environment variables.
hooksandmigratehanded
wtpaths through the environment (WT_CONFIG=,WORKTREE_ROOT=) andread paths back out of it. The harness now exports every base path in both
forms (
$..._NATIVEto givewt,$..._POSIXto assert on); off Windows thetwo are the same string, so scenarios stay portable.
migrate's hand-built$REPO_DIR/../worktreesturned out to be the same directory the harnessalready exports as
WORKTREE_ROOT, so that crossing is removed rather thanpatched.
Genuinely cannot run — 5
hooksscenarios.wtspawns hook commandsitself, through
cmd /con Windows (runHooks), so the calling shell isirrelevant: a body like
touch $WT_PATH/.hook-rannever gets$WT_PATHexpanded and has no POSIX utilities. These keep
skip_os: [windows], now witha comment saying why — the missing reason is what made #115 necessary.
Verifying
The
E2E (windows, bash)leg reported 80 passed / 25 skipped on #114. If everyenabled scenario passes it should now read 96 passed / 9 skipped. A scenario
that silently keeps skipping is indistinguishable from one that passes in the
check status, so the summary counts are the thing to read.
Locally on macOS (bash, zsh, fish): 292 passed, 0 failed, 23 skipped —
unchanged from before, as expected.