Skip to content

test(core): spell private_dir test paths through the canonical tempdir - #3317

Merged
inureyes merged 1 commit into
mainfrom
fix/private-dir-tests-macos-tmpdir
Nov 23, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/private-dir-tests-macos-tmpdir

Conversation

@inureyes

Copy link
Copy Markdown
Member

Three private_dir tests from #3289 fail on macOS: creates_the_chain_owner_only_and_accepts_it, the_managed_chain_loses_group_write_but_an_explicit_root_does_not, and a_directory_above_the_root_that_others_can_write_is_refused.

The temp dir on macOS is under /var, a symlink to /private/var. ensure_private_dir respells the chain through the canonical parent of the root, and verify_trusted_ancestors documents that its input is already canonical, so the tests compared /private/var/... results against /var/... expectations and walked a symlinked ancestor. The production code is correct; only the test inputs were non-canonical, which Linux CI never exposes.

The tests now build their paths from a canonical_tempdir() helper.

Validation: cargo test -p mlxcel-core --lib private_dir passes 11/11 on macOS (M3 Ultra); cargo fmt --check clean. Test-only change.

On macOS the temp dir lives under /var, a symlink to /private/var. ensure_private_dir respells the chain through the canonical parent of the root and verify_trusted_ancestors expects a canonical path, so three tests added in #3289 failed on a Mac: the ancestor walk hit Symlink("/var"), and the returned leaf and error paths were /private/var/... while the tests compared against /var/.... Production behavior is correct; only the test inputs were non-canonical. CI on Linux never saw it.

The tests now take their base from a canonical_tempdir() helper. cargo test -p mlxcel-core --lib private_dir: 11 passed on macOS.
@inureyes inureyes added the type:test Test related changes label Nov 23, 2026
@inureyes
inureyes merged commit a80f153 into main Nov 23, 2026
33 checks passed
@inureyes
inureyes deleted the fix/private-dir-tests-macos-tmpdir branch November 23, 2026 07:35
@inureyes inureyes added status:done Completed priority:low Low priority labels Nov 30, 2026
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low Low priority status:done Completed type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant