Skip to content

Fix macOS test failures from /var symlink canonicalization#16

Merged
vyadh merged 3 commits into
fix/mac-testsfrom
copilot/fix-test-path-issues
Jan 20, 2026
Merged

Fix macOS test failures from /var symlink canonicalization#16
vyadh merged 3 commits into
fix/mac-testsfrom
copilot/fix-test-path-issues

Conversation

Copilot AI commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

On macOS, /var is a symlink to /private/var. Tests were failing because glob returns /var/* paths while test assertions using path expand expect /private/var/*.

Changes

  • Canonicalize glob results in discover.nu by applying path expand to ensure consistent path resolution across platforms
# Before
def list-files [pattern: string]: [nothing -> list<string>] {
  glob $pattern | path relative-to $env.PWD
}

# After  
def list-files [pattern: string]: [nothing -> list<string>] {
  glob $pattern | each { path expand } | path relative-to $env.PWD
}

This ensures both discovery and test assertions return the same canonical paths.

Original prompt

The tests are failing on Mac where we're expecting a folder with prefix /private/var but the actual paths are just /var. Identify the cause and fix the tests


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Apply path expand to glob results to ensure consistent path resolution.
On macOS, /var is a symlink to /private/var, and this ensures both
discover suite-files and test assertions return the same canonical paths.

Co-authored-by: vyadh <3620650+vyadh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test failures due to incorrect folder paths Fix macOS test failures from /var symlink canonicalization Jan 20, 2026
Copilot AI requested a review from vyadh January 20, 2026 17:57
@github-actions

Copy link
Copy Markdown

Test Results

  1 files  ±0   16 suites  ±0   0s ⏱️ ±0s
122 tests ±0  118 ✅ +3  4 💤 ±0  0 ❌  - 3 
122 runs  ±0  114 ✅ +3  8 💤 ±0  0 ❌  - 3 

Results for commit 565053f. ± Comparison against base commit 287e74a.

1 similar comment
@github-actions

Copy link
Copy Markdown

Test Results

  1 files  ±0   16 suites  ±0   0s ⏱️ ±0s
122 tests ±0  118 ✅ +3  4 💤 ±0  0 ❌  - 3 
122 runs  ±0  114 ✅ +3  8 💤 ±0  0 ❌  - 3 

Results for commit 565053f. ± Comparison against base commit 287e74a.

@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown

Test Results

  1 files  ±0   16 suites  ±0   0s ⏱️ ±0s
122 tests ±0  118 ✅ +3  4 💤 ±0  0 ❌  - 3 
122 runs  ±0  114 ✅ +3  8 💤 ±0  0 ❌  - 3 

Results for commit acf4c5f. ± Comparison against base commit 287e74a.

♻️ This comment has been updated with latest results.

@vyadh vyadh marked this pull request as ready for review January 20, 2026 20:01
@vyadh vyadh merged commit f7041d5 into fix/mac-tests Jan 20, 2026
23 of 25 checks passed
@vyadh vyadh deleted the copilot/fix-test-path-issues branch January 20, 2026 20:04
vyadh added a commit that referenced this pull request Jan 20, 2026
* Initial plan

* Fix macOS path canonicalization in discover.nu

Apply path expand to glob results to ensure consistent path resolution.
On macOS, /var is a symlink to /private/var, and this ensures both
discover suite-files and test assertions return the same canonical paths.

Co-authored-by: vyadh <3620650+vyadh@users.noreply.github.com>

* fix: add reasons normalize paths on macOS by expanding symlinks in discover

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: vyadh <3620650+vyadh@users.noreply.github.com>
Co-authored-by: Kieron Wilkinson <kieron.wilkinson@gmail.com>
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