From 1822756afee3980f0e341eee716972c6dc38824b Mon Sep 17 00:00:00 2001 From: mvalentsev Date: Sat, 9 May 2026 04:12:18 +0500 Subject: [PATCH] fix(test_sync): use tmp_dir for elsewhere path so it stays absolute on Windows Windows runs treated `/tmp/elsewhere/x.md` as relative because Windows absolute paths require a drive letter, so `_classify_drawer` routed `drawer_out_of_scope` to `no_source` instead of `out_of_scope` and `test_dry_run_classifies_correctly` failed on test-windows. `Path(tmp_dir) / "elsewhere" / "x.md"` is absolute on every platform and still lives outside the project root that the synced_world fixture exposes via `repo_path`, so the bucket assertions hold cross-platform. --- tests/test_sync.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index 6ab2251..ea17040 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -12,7 +12,7 @@ import chromadb import pytest -def _seed_drawers(palace_path, repo_path, deleted_path): +def _seed_drawers(palace_path, repo_path, deleted_path, elsewhere_path): """Populate the drawers collection with 6 entries covering all buckets.""" client = chromadb.PersistentClient(path=palace_path) col = client.get_or_create_collection("mempalace_drawers", metadata={"hnsw:space": "cosine"}) @@ -61,7 +61,7 @@ def _seed_drawers(palace_path, repo_path, deleted_path): { "wing": "demo", "room": "elsewhere", - "source_file": "/tmp/elsewhere/x.md", + "source_file": str(elsewhere_path), "chunk_index": 0, "added_by": "miner", "filed_at": "2026-05-09T00:00:00", @@ -104,7 +104,10 @@ def synced_world(tmp_dir, palace_path): deleted.write_text("# was here\n") deleted.unlink() - _seed_drawers(palace_path, repo_path, deleted) + # Use tmp_dir for an absolute path; `/tmp/...` literals are not absolute on Windows. + elsewhere = Path(tmp_dir) / "elsewhere" / "x.md" + + _seed_drawers(palace_path, repo_path, deleted, elsewhere) return {"palace_path": palace_path, "repo_path": str(repo_path)}