Repository navigation
test(core): spell private_dir test paths through the canonical tempdir - #3317
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three
private_dirtests 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, anda_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_dirrespells the chain through the canonical parent of the root, andverify_trusted_ancestorsdocuments 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_dirpasses 11/11 on macOS (M3 Ultra);cargo fmt --checkclean. Test-only change.