Repository navigation
Fix macOS agent_install test portability and add macos-15 CI - #138
Open
vanshksingh wants to merge 1 commit into
Open
vanshksingh wants to merge 1 commit into
vanshksingh wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Problem
On macOS,
TempDir::new()creates directories under/var/folders/..., which is a symlink to/private/var/folders/.... Intests/agent_install.rs,unattended_registration_preserves_settings_and_uses_the_installed_binaryandinstall_messages_name_the_configuration_by_its_plain_pathcompared uncanonicalized paths against the canonicalized path recorded or printed byproofline agent install, causing failures whenTMPDIRis not already canonicalized.In addition,
.github/workflows/ci.ymlonly rancargo test --lockedonubuntu-24.04, leaving macOS-specific behavior (_NSGetExecutablePathsymlink preservation vs. Linux/proc/self/exe) untested in CI.Approach
root.path()before constructing expected paths inunattended_registration_preserves_settings_and_uses_the_installed_binaryandinstall_messages_name_the_configuration_by_its_plain_pathwhile preserving strict path equality.unattended_registration_via_symlink_configures_runnable_binaryintests/agent_install.rsto verify symlink invocation preserves the invocation path on macOS, resolves to the target binary on Linux, and produces a runnable configured executable.macos(macos-15) job to.github/workflows/ci.ymlrunningcargo fmt --check,cargo clippy --locked --all-targets -- -D warnings, andcargo test --locked.Verification
Ran on
origin/main(f95504f,v0.11.6):cargo fmt --check(exit 0)cargo clippy --locked --all-targets -- -D warnings(exit 0)TMPDIR=/private/tmp cargo test --locked(exit 0, including all 5agent_installtests; 1hookstest ignored becausepre-commitis not installed)git diff --check(exit 0)Proofline review evaluation
Ran Proofline (
prooflinedev[bot]) and GitHub Actions (macos-15,ubuntu-24.04,windows-2025) on this branch in my fork (vanshksingh/cli_proofline#2):configured_path == binary) suggested by Proofline.macos-15CI job immediately caught the same/var->/private/varcanonicalization failure ininstall_messages_name_the_configuration_by_its_plain_path(added inv0.11.2), which is fixed here.vanshksingh/cli_proofline#2(Prooflinewith 0 new findings,macos,check,windows) passed.