Skip to content

[codex] Fix Windows workspace CI tests#1056

Merged
alfred-openspec merged 1 commit intomainfrom
codex/fix-main-ci
May 6, 2026
Merged

[codex] Fix Windows workspace CI tests#1056
alfred-openspec merged 1 commit intomainfrom
codex/fix-main-ci

Conversation

@TabishB
Copy link
Copy Markdown
Contributor

@TabishB TabishB commented May 6, 2026

Summary

Fixes the failing main CI Windows test job by aligning the workspace tests with the intended Windows path behavior.

Root cause

The latest main CI failure was in Test (windows-pwsh) for workflow run 25415627238. The workspace implementation canonicalizes existing Windows paths before persisting or using them in generated workspace surfaces, expanding short temp aliases like C:\Users\RUNNER~1\... to long paths like C:\Users\runneradmin\.... A few test assertions for generated .code-workspace files and unavailable-opener messages still expected the short alias.

One interactive test also replaced PATH with only a fake bin directory. On Windows that can remove the system shell path needed to launch a .cmd shim, leaving process.exitCode set to 1 even though the fake opener was meant to succeed.

Changes

  • Compare generated workspace folder paths and manual workspace-file paths against canonicalized expected paths on Windows.
  • Prepend the fake opener bin directory to the existing PATH in the interactive opener test instead of replacing PATH.
  • Loosen the opener-choice assertion so it remains valid when additional supported tools are installed locally.

Validation

  • pnpm vitest run test/commands/workspace.test.ts test/commands/workspace.interactive.test.ts
  • pnpm test
  • pnpm run build
  • pnpm exec tsc --noEmit
  • pnpm lint

Summary by CodeRabbit

Release Notes

  • Tests
    • Improved cross-platform path handling in workspace tests to ensure robust behavior across different operating systems
    • Updated path canonicalization in VS Code integration tests for consistency
    • Refined workspace opener preference validation tests

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09fdb269-d32a-4c05-be4d-4285421f81a1

📥 Commits

Reviewing files that changed from the base of the PR and between 1cdf041 and 2890afc.

📒 Files selected for processing (2)
  • test/commands/workspace.interactive.test.ts
  • test/commands/workspace.test.ts

📝 Walkthrough

Walkthrough

This PR updates two workspace test files to handle platform-robust path canonicalization and improve PATH environment variable detection. Changes include computing the correct PATH-like environment variable key dynamically (case-insensitive), using canonicalized paths in VS Code editor assertions, and refining opener selection validation logic.

Changes

Platform-Robust Path Handling in Workspace Tests

Layer / File(s) Summary
Path Canonicalization Setup
test/commands/workspace.test.ts
Introduced expectedApi constant using expectedExistingPath() to canonicalize the API directory path for consistent assertions across platforms.
Path Assertion Updates
test/commands/workspace.test.ts
Updated code-workspace folders assertion and error-message path validation to use canonicalized paths (expectedApi, expectedCheckout, and canonicalized workspace root) instead of raw directory paths.
Platform-Robust Environment Handling
test/commands/workspace.interactive.test.ts
Replaced direct PATH assignment with dynamic, case-insensitive detection of the appropriate PATH-like environment variable key, then prepends binDir to it.
Opener Selection Validation
test/commands/workspace.interactive.test.ts
Refactored assertions for the "Open with" prompt to validate that the default chosen opener is 'editor' and available choices include 'editor' and 'github-copilot', removing prior codex/PATH-specific expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#972: Directly related—both PRs address canonicalized filesystem paths in tests; PR #972 updates FileSystemUtils to prefer realpath.native for canonicalization.
  • Fission-AI/OpenSpec#1050: Both PRs update workspace test assertions to use canonicalized paths and align with canonicalization introduced in workspace resolution.
  • Fission-AI/OpenSpec#1054: Test changes here adapt to workspace-open behavior and getWorkspaceCodeWorkspacePath updates introduced in PR #1054.

Suggested reviewers

  • alfred-openspec

Poem

🐰 Paths once tangled, now run straight and true,
Canonicalize all, on Windows and Unix too!
Openers choose wisely, with choices so clear,
Platform-robust tests bring devs joy and cheer! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main objective: fixing Windows workspace CI tests by handling path canonicalization and PATH environment variable handling on Windows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-main-ci

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 and usage tips.

@TabishB TabishB marked this pull request as ready for review May 6, 2026 04:11
Copy link
Copy Markdown
Collaborator

@alfred-openspec alfred-openspec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. CI is green and the Windows path expectations line up with the implementation.

@alfred-openspec alfred-openspec added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit ff506c3 May 6, 2026
11 of 12 checks passed
@alfred-openspec alfred-openspec deleted the codex/fix-main-ci branch May 6, 2026 04:17
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