Skip to content

Fix macOS agent_install test portability and add macos-15 CI - #138

Open
vanshksingh wants to merge 1 commit into
prooflinedev:mainfrom
vanshksingh:ci/macos-agent-install-tests-upstream
Open

vanshksingh wants to merge 1 commit into
prooflinedev:mainfrom
vanshksingh:ci/macos-agent-install-tests-upstream

Conversation

@vanshksingh

Copy link
Copy Markdown

Problem

On macOS, TempDir::new() creates directories under /var/folders/..., which is a symlink to /private/var/folders/.... In tests/agent_install.rs, unattended_registration_preserves_settings_and_uses_the_installed_binary and install_messages_name_the_configuration_by_its_plain_path compared uncanonicalized paths against the canonicalized path recorded or printed by proofline agent install, causing failures when TMPDIR is not already canonicalized.

In addition, .github/workflows/ci.yml only ran cargo test --locked on ubuntu-24.04, leaving macOS-specific behavior (_NSGetExecutablePath symlink preservation vs. Linux /proc/self/exe) untested in CI.

Approach

  • Canonicalized root.path() before constructing expected paths in unattended_registration_preserves_settings_and_uses_the_installed_binary and install_messages_name_the_configuration_by_its_plain_path while preserving strict path equality.
  • Added unattended_registration_via_symlink_configures_runnable_binary in tests/agent_install.rs to verify symlink invocation preserves the invocation path on macOS, resolves to the target binary on Linux, and produces a runnable configured executable.
  • Added a macos (macos-15) job to .github/workflows/ci.yml running cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, and cargo 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 5 agent_install tests; 1 hooks test ignored because pre-commit is 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):

  • Added the Linux raw-path equality assertion (configured_path == binary) suggested by Proofline.
  • The new macos-15 CI job immediately caught the same /var -> /private/var canonicalization failure in install_messages_name_the_configuration_by_its_plain_path (added in v0.11.2), which is fixed here.
  • All checks on vanshksingh/cli_proofline#2 (Proofline with 0 new findings, macos, check, windows) passed.

This branch has not been deployed

No deployments
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.

1 participant