test(hooks): canonicalize CWD paths across platforms - #673
Conversation
There was a problem hiding this comment.
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-Issue628CanonicalPathhelper to canonicalize filesystem paths for comparison across platforms. - Updated
Assert-VerifyCwdMarkerto 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.
|
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. |
Summary
pwd -Pon macOS/Linux so/var/...and/private/var/...resolve to the same physical directoryGet-Item.FullNameon Windows to expand short-name aliases where supportedCloses #672.
Validation
pwsh tests/Test-Hooks.ps1— 71 passedpwsh tests/Test-ProcessDispatch.ps1— 44 passedpwsh tests/Test-Structure.ps1— 356 passed, 2 optional skipspwsh tests/Run-Tests.ps1— layers 1–3 all passedThis is intentionally limited to the #642 test regression; #669 remains separate.