Repository navigation
test(agent): resolve recorded executable path before comparing - #116
Open
antonyth18 wants to merge 1 commit into
Open
antonyth18 wants to merge 1 commit into
antonyth18 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.
Fixes #112
Summary
unattended_registration_preserves_settings_and_uses_the_installed_binaryintests/agent_install.rsfails on macOS because/varis a symlink to/private/var. The test resolved symlinks in its expected path withcanonicalize(), but the CLI recordsstd::env::current_exe(), which on macOS returns the path without resolving them. Both paths name the same file, so only the comparison was wrong.This PR canonicalizes the path the CLI wrote before comparing, so both sides are resolved the same way.
The CLI itself is unchanged, as suggested in the issue. Canonicalizing in
src/agent/config.rswould turn a symlinked launch path, such as one managed by a package manager, into a versioned target path that goes stale after an upgrade.Testing
mainon macOS 14.5 withcargo test --locked --test agent_install.agent_installpass.cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningsare clean.canonicalize()adds a\\?\prefix there, but it now applies to both sides of the comparison, so CI should stay green.