From 598965c389e54da4d114f863a0fc083da76a10fe Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Fri, 12 Jun 2026 17:04:36 -0500 Subject: [PATCH] test(sync): use OS-absolute paths in watch selection tests The absolute-path sync guard from the previous commit now checks every project's path, not just cloud-mode ones. Three existing watch-selection tests hardcoded POSIX paths like "/tmp/alpha", which are absolute on Linux/macOS but not on Windows (no drive letter), so the guard filtered them out and the tests failed on windows-latest. Build the project paths from the tmp_path fixture so they are absolute on every platform. Production paths are unaffected: real local projects are always resolved to OS-absolute paths at creation. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Drew Cain --- tests/sync/test_watch_service.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/sync/test_watch_service.py b/tests/sync/test_watch_service.py index 2a8ac200..e5c4d211 100644 --- a/tests/sync/test_watch_service.py +++ b/tests/sync/test_watch_service.py @@ -71,15 +71,18 @@ async def _register_local_projects( @pytest.mark.asyncio async def test_select_projects_to_watch_returns_all_when_unconstrained( - app_config: BasicMemoryConfig, project_repository + app_config: BasicMemoryConfig, project_repository, tmp_path ): """Without a --project constraint, every active project is watched.""" + # Use tmp_path so the project paths are OS-absolute on Windows too — a + # POSIX-style "/tmp/alpha" is not absolute on Windows (no drive letter), + # and _select_projects_to_watch now skips non-absolute paths (issue #949). await _register_local_projects( app_config, project_repository, [ - {"name": "project-alpha", "path": "/tmp/alpha"}, - {"name": "project-beta", "path": "/tmp/beta"}, + {"name": "project-alpha", "path": str(tmp_path / "alpha")}, + {"name": "project-beta", "path": str(tmp_path / "beta")}, ], ) @@ -94,7 +97,7 @@ async def test_select_projects_to_watch_returns_all_when_unconstrained( @pytest.mark.asyncio async def test_select_projects_to_watch_filters_to_constrained_project( - app_config: BasicMemoryConfig, project_repository + app_config: BasicMemoryConfig, project_repository, tmp_path ): """With ``constrained_project`` set, only that project is returned. @@ -106,8 +109,8 @@ async def test_select_projects_to_watch_filters_to_constrained_project( app_config, project_repository, [ - {"name": "project-alpha", "path": "/tmp/alpha"}, - {"name": "project-beta", "path": "/tmp/beta"}, + {"name": "project-alpha", "path": str(tmp_path / "alpha")}, + {"name": "project-beta", "path": str(tmp_path / "beta")}, ], ) @@ -124,13 +127,13 @@ async def test_select_projects_to_watch_filters_to_constrained_project( @pytest.mark.asyncio async def test_select_projects_to_watch_empty_when_constrained_project_missing( - app_config: BasicMemoryConfig, project_repository + app_config: BasicMemoryConfig, project_repository, tmp_path ): """An unknown constraint yields an empty watch set rather than watching everything.""" await _register_local_projects( app_config, project_repository, - [{"name": "project-alpha", "path": "/tmp/alpha"}], + [{"name": "project-alpha", "path": str(tmp_path / "alpha")}], ) service = WatchService(