Skip to content

test(e2e): enable 16 of the 21 Windows-skipped scenarios under Git Bash - #116

Merged
timvw merged 8 commits into
mainfrom
e2e-windows-gitbash-115
Aug 10, 2026
Merged

test(e2e): enable 16 of the 21 Windows-skipped scenarios under Git Bash#116
timvw merged 8 commits into
mainfrom
e2e-windows-gitbash-115

Conversation

@timvw

@timvw timvw commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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, inline VAR=x cmd, empty env vars) that PowerShell can't parse
but 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. hooks and migrate
handed wt paths through the environment (WT_CONFIG=, WORKTREE_ROOT=) and
read paths back out of it. The harness now exports every base path in both
forms ($..._NATIVE to give wt, $..._POSIX to assert on); off Windows the
two are the same string, so scenarios stay portable. migrate's hand-built
$REPO_DIR/../worktrees turned out to be the same directory the harness
already exports as WORKTREE_ROOT, so that crossing is removed rather than
patched.

Genuinely cannot run — 5 hooks scenarios. wt spawns hook commands
itself, through cmd /c on Windows (runHooks), so the calling shell is
irrelevant: a body like touch $WT_PATH/.hook-ran never gets $WT_PATH
expanded and has no POSIX utilities. These keep skip_os: [windows], now with
a 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 every
enabled 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.

timvw added 8 commits August 10, 2026 14:06
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

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.80%. Comparing base (10dcef7) to head (166e2a5).

Files with missing lines Patch % Lines
e2e/run.go 0.00% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
e2e/run.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

@timvw
timvw merged commit 57d7103 into main Aug 10, 2026
16 checks passed
@timvw
timvw deleted the e2e-windows-gitbash-115 branch August 10, 2026 14:37
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.

e2e: enable the 21 scenarios skipped on Windows under the Git Bash leg

1 participant