Skip to content

fix(cli): make cwd snapshot tests portable on Windows - #431

Merged
andrei-hasna merged 2 commits into
mainfrom
fix/codex-cli-windows-path-tests
Jul 28, 2026
Merged

fix(cli): make cwd snapshot tests portable on Windows#431
andrei-hasna merged 2 commits into
mainfrom
fix/codex-cli-windows-path-tests

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Why

The rust-ci-full Windows x64 run 30317403819 exposed three deterministic codex-cli test failures. Two tests used Unix-only /target fixtures, which are not absolute Windows paths. A third compared serialized path text, so the same temporary directory failed when Windows represented it through an 8.3 short path with different casing.

What changed

  • Use tempfile::TempDir for launcher and requested working directories so fixtures are absolute on every platform.
  • Compare the snapshotted workspace root with paths_match_after_normalization instead of a hardcoded string.
  • Inspect structured permission-profile path entries and compare filesystem identity, avoiding long-path versus short-path spelling assumptions.
  • Keep production snapshot behavior unchanged; this PR changes tests only.

Verification

  • just test-fast -p codex-cli runtime_context_from_config_keeps_workspace_permissions_symbolic_for_cwd_snapshot (1 passed)
  • just test-fast -p codex-cli explicit_cwd_snapshot_ (2 passed)
  • just test -p codex-cli agent_cmd::tests:: (9 passed)
  • just fix -p codex-cli
  • just fmt
  • Staged and 2968352..HEAD gitleaks scans (no leaks)

The full just test-fast -p codex-cli run passed 311 of 312 tests, including all changed tests. The sole failure was the unchanged sandbox_with_network_proxy_blocks_direct_loopback_access, where local curl timed out with exit 28 instead of the expected connection-refused exit 7.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@andrei-hasna
andrei-hasna merged commit 7958daf into main Jul 28, 2026
43 of 65 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant