Skip to content

test(hooks): canonicalize CWD paths across platforms - #673

Closed
carlospedreira wants to merge 1 commit into
mainfrom
codex/fix-hook-cwd-canonical-paths
Closed

test(hooks): canonicalize CWD paths across platforms#673
carlospedreira wants to merge 1 commit into
mainfrom
codex/fix-hook-cwd-canonical-paths

Conversation

@carlospedreira

Copy link
Copy Markdown
Collaborator

Summary

  • canonicalize expected and recorded verify-hook CWD paths before comparison
  • use pwd -P on macOS/Linux so /var/... and /private/var/... resolve to the same physical directory
  • use Get-Item.FullName on Windows to expand short-name aliases where supported
  • preserve the five-marker, intended-directory, and single-consistent-CWD assertions

Closes #672.

Validation

  • pwsh tests/Test-Hooks.ps1 — 71 passed
  • pwsh tests/Test-ProcessDispatch.ps1 — 44 passed
  • pwsh tests/Test-Structure.ps1 — 356 passed, 2 optional skips
  • pwsh tests/Run-Tests.ps1 — layers 1–3 all passed

This is intentionally limited to the #642 test regression; #669 remains separate.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a cross-platform test regression in the verify-hook CWD assertions by canonicalizing both the expected directory and the recorded marker directories immediately before comparison. This ensures macOS /var/... vs /private/var/... symlink aliases (and Windows short/long path aliases) don’t cause false-negative failures while preserving the original semantic guarantees from the #628/#642 regression tests.

Changes:

  • Added a Resolve-Issue628CanonicalPath helper to canonicalize filesystem paths for comparison across platforms.
  • Updated Assert-VerifyCwdMarker to compare canonicalized expected/actual CWD values and to enforce “single consistent CWD” using canonicalized marker paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@carlospedreira

Copy link
Copy Markdown
Collaborator Author

Closing without merge: required Windows CI remained hung in the Run Layers 1-3 step after macOS, Ubuntu, UI E2E, and link checks passed. The implementation and test evidence are being returned to #672 for another contributor. Branch codex/fix-hook-cwd-canonical-paths and commit 7ab53db are intentionally preserved as reference work.

@github-project-automation github-project-automation Bot moved this from Inbox to Done in Dotbot Product Backlog Aug 2, 2026
@carlospedreira
carlospedreira deleted the codex/fix-hook-cwd-canonical-paths branch August 2, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

tests: canonicalize verify-hook CWD comparisons on macOS

2 participants