test: make cross-platform assertions Windows-safe#5
Open
logan-jl-cc wants to merge 1 commit into
Open
Conversation
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>
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.
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
config-paths,codex-title-source,local-fs— expected paths built withpath.joininstead of hardcoded/pty-env— acceptCOMSPEC/ComSpec(Object.entries preserves Windows casing)local-conversation— Codex notify:powershell.exe -Fileon Windows,bash -con POSIXclaude-trust-service— config path viapath.join; idempotent fixture keyed bypath.resolvedependency-manager— mock bothwhich(POSIX) andwhere(Windows)project-settings— expect platform-specific default worktree dir (Windows falls back to~/Yoda/worktreessince/tmpcan't be validated)scanCodexSkills— tolerate symlink creation failure on Windows (needs Developer Mode)userEnv— skip the AppImage-only suite on Windowsworktree-service— retryrmSyncon Windows EPERM teardown; normalize existing-checkout path compareVerification
Tested on Windows 11 + Node 24.
pnpm typecheckandpnpm lintare 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-servicegetWorktree— returnsundefinedon Windows because of astartsWithpath-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-fstime-budget truncation — timing-sensitive by design (timeBudgetMs: 1over 1000 files); flaky under load.🤖 Generated with Claude Code