Skip to content

test: make cross-platform assertions Windows-safe#5

Open
logan-jl-cc wants to merge 1 commit into
lovstudio:mainfrom
logan-jl-cc:test/cross-platform-windows-assertions
Open

test: make cross-platform assertions Windows-safe#5
logan-jl-cc wants to merge 1 commit into
lovstudio:mainfrom
logan-jl-cc:test/cross-platform-windows-assertions

Conversation

@logan-jl-cc

Copy link
Copy Markdown

Summary

Makes ~30 Windows-only test failures go away by making assertions platform-agnostic. These were all test-side platform assumptions (path separators, env-var casing, POSIX shell commands, file locks, symlinks) — not code regressions. No production code changed. The suite is macOS/Linux-first; these changes keep macOS/CI green while fixing Windows.

Changes by category

Area Fix
Path separators config-paths, codex-title-source, local-fs — expected paths built with path.join instead of hardcoded /
Env-var casing pty-env — accept COMSPEC/ComSpec (Object.entries preserves Windows casing)
Platform branch local-conversation — Codex notify: powershell.exe -File on Windows, bash -c on POSIX
Path resolution claude-trust-service — config path via path.join; idempotent fixture keyed by path.resolve
Probe command dependency-manager — mock both which (POSIX) and where (Windows)
Platform default project-settings — expect platform-specific default worktree dir (Windows falls back to ~/Yoda/worktrees since /tmp can't be validated)
Symlinks scanCodexSkills — tolerate symlink creation failure on Windows (needs Developer Mode)
POSIX-only userEnv — skip the AppImage-only suite on Windows
File locks worktree-service — retry rmSync on Windows EPERM teardown; normalize existing-checkout path compare

Verification

Tested on Windows 11 + Node 24. pnpm typecheck and pnpm lint are clean. Of the previously failing ~30 tests, all now pass on Windows except two tracked separately below. All assertions resolve identically on POSIX, so macOS/CI stay green.

Not addressed (separate concerns)

  • worktree-service getWorktree — returns undefined on Windows because of a startsWith path-prefix compare that breaks on \ vs /. This looks like a real production bug (worktree-service.ts, checkedOutPath.startsWith(realPoolPath)), so it's left for a code change rather than being papered over in the test.
  • local-fs time-budget truncation — timing-sensitive by design (timeBudgetMs: 1 over 1000 files); flaky under load.

🤖 Generated with Claude Code

The suite is macOS/Linux-first; ~30 assertions failed on Windows purely from
platform assumptions (path separators, env-var casing, POSIX shell commands,
file locks, symlinks) — not code regressions. Make assertions platform-agnostic
so they pass on Windows while staying green on POSIX. No production code changed.

- config-paths / codex-title / local-fs: build expected paths with path.join
  instead of hardcoded forward slashes
- pty-env: accept COMSPEC in either casing (Object.entries preserves it)
- local-conversation: branch the Codex notify assertion by platform
  (powershell.exe -File on Windows, bash -c on POSIX)
- claude-trust-service: build config path with path.join; key the idempotent
  fixture by path.resolve so it matches the provider's lookup
- dependency-manager: mock both `which` and `where` probe commands
- project-settings: expect the platform-specific default worktree dir
  (Windows falls back to ~/Yoda/worktrees since /tmp cannot be validated)
- scanCodexSkills: tolerate symlink creation failure on Windows
- userEnv: skip the AppImage-only suite on Windows (resolveUserEnv early-returns)
- worktree-service: retry rmSync on Windows EPERM teardown; normalize the
  existing-checkout path comparison

Two Windows failures remain and are tracked separately (not addressed here):
- worktree-service getWorktree path-prefix compare — real bug, production code
- local-fs time-budget truncation — timing-sensitive by design

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant