Make cargo test --all pass on macOS #269
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/hermetic-config-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cargo test --allcould not finish on a Mac. Every failure was a test reading the developer's real machine instead of its own scratch state.ProjectDirsignoresXDG_CONFIG_HOMEon macOS and resolves to~/Library/Application Support, so the host-resolution tests and the SIGINT backstop tests were loading the realhosts.toml. When that named a host whose token lives in the login keychain, the lookup then blocked forever inside securityd: a keychain item's ACL names the binaries allowed to read it, and a freshly built test binary is not one of them, so the read hangs instead of failing. Diagnosing it needssample <pid>, because from the outside it just looks like a test that never returns.FJ_CONFIG_DIRnames the config directory outright andFJ_NO_KEYCHAINkeeps token reads, writes and deletes in the 0600 file store, which is where those tests had put their tokens anyway. Both are useful to any scripted run that wants its own state, so they are in the README table rather than hidden behindcfg(test).Two more, found once the suite could get that far:
/bin/false, which exists on Linux but not on macOS, so it asserted on a spawn failure rather than the nonzero exit it was written for. It now writes its own failing script, the way the sibling test already writes its own editor.No production behaviour changes beyond the two new escape hatches, both of which default to today's resolution when unset.
Verified locally:
cargo fmt --checkclean,cargo clippy --all-targets --all-features -- -D warningsclean,cargo test --allgreen (794 + 5 + 1, exit 0) on macOS 26.