Repository navigation
test: fix macOS test failures caused by the /var temp symlink - #6
Merged
Merged
Conversation
macOS temp directories live under /var, a symlink to /private/var. The store opens SQLite with SQLITE_OPEN_NOFOLLOW, so tests that open the index through the raw temp path failed with SQLITE_CANTOPEN_SYMLINK, and the rebind test passed a --from that differed from the recorded canonical root. Canonicalize the temp root at those call sites, as the CLI and the MCP tests already do. Test-only change.
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.
Follow-up to #5. With the
mkfifoatcompile error fixed, the macOS job reachedcrates/cli/tests/investigate.rsand all 11 tests failed withSQLITE_CANTOPEN_SYMLINK(error code 1550).Cause
macOS temp directories live under
/var, which is a symlink to/private/var. The store opens SQLite withSQLITE_OPEN_NOFOLLOW, which rejects any symlink in the path. The CLI canonicalizes the repository root, but a few tests call the library directly with the raw temp path. One test also passed a non-canonicalmemory rebind --from, which must match the recorded canonical root exactly.Because
cargo teststops at the first failing test binary, more files were affected than CI showed. Running the suite on Linux withTMPDIRpointing at a symlink reproduced 32 failures across 5 files:investigate,knowledge,knowledge_relationships,knowledge_hardeningandmemory_durability.Fix
Canonicalize the temp root at those call sites, as the MCP tests already do. Test-only change; product behavior is unchanged.
Verification
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings: pass.cargo test --workspace --no-fail-fast: 292 passed, 0 failed, both with the defaultTMPDIRand with a symlinkedTMPDIRthat reproduces the macOS layout.