From e9fed96518757f0e8c1c09bc5fac58d70f306d24 Mon Sep 17 00:00:00 2001 From: Paddy Date: Mon, 20 Apr 2026 14:54:37 -0700 Subject: [PATCH] =?UTF-8?q?fix(drone):=20resolve=20tempdir=20fixture=20in?= =?UTF-8?q?=20registry=5Fhandler=20tests=20=E2=80=94=20unblock=20Mac=20(is?= =?UTF-8?q?sue=20#360=20finding=20A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/aipass/drone/tests/test_registry_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aipass/drone/tests/test_registry_handler.py b/src/aipass/drone/tests/test_registry_handler.py index 572dd28b..10cf0122 100644 --- a/src/aipass/drone/tests/test_registry_handler.py +++ b/src/aipass/drone/tests/test_registry_handler.py @@ -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)