fix(drone): resolve tempdir fixture in registry_handler tests — unblock Mac (issue #360 finding A1)
Two tests failed on macOS due to the /var/folders → /private/var/folders symlink:
- test_relative_paths_resolved (line 126: string startswith mismatch)
- test_find_registry_from_child_dir (line 377: Path == comparison)
Root cause: tempfile.mkdtemp() returns the unresolved /var/folders/... form on Mac. Production code (PR #361 / 8a5fbf6) correctly calls Path.resolve() which follows the symlink and canonicalizes to /private/var/folders/.... The test fixture's registry_dir stored the unresolved form, so one side of each comparison had /private/ and the other didn't.
One-line fix: .resolve() the fixture path too so both sides are canonical on every platform.
Platform behavior:
- Linux: no-op (no symlink, path already canonical) — was passing, stays passing
- macOS: follows /var/folders → /private/var/folders — was failing (2/33), now passing (33/33)
- Windows: normalizes short-path to long-path consistently with production code — was passing, stays passing
Verified locally on macOS 12.7.6 Intel: 33/33 in test_registry_handler.py green after fix.
Surfaced during the Mac install feedback session on issue #360. Linux @devpulse green-lit the direct PR.
Follow-up recommendation (NOT this PR, separate cleanup): migrate registry_dir fixture to pytest's built-in tmp_path, which returns a pre-resolved Path. Eliminates the class of fixture bug entirely across the test suite.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,7 @@ from aipass.drone.apps.handlers.exceptions import (
|
||||
@pytest.fixture
|
||||
def registry_dir() -> Generator[Path, None, None]:
|
||||
"""Isolated temp directory for registry tests; cleaned up after."""
|
||||
d = Path(tempfile.mkdtemp(prefix="reg_test_"))
|
||||
d = Path(tempfile.mkdtemp(prefix="reg_test_")).resolve()
|
||||
yield d
|
||||
shutil.rmtree(d, ignore_errors=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user