Skip to content

Commit 0414ce9

Browse files
groksrcclaude
andcommitted
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) <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@gmail.com>
1 parent 587cc80 commit 0414ce9

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

tests/sync/test_watch_service.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,18 @@ async def _register_local_projects(
7171

7272
@pytest.mark.asyncio
7373
async def test_select_projects_to_watch_returns_all_when_unconstrained(
74-
app_config: BasicMemoryConfig, project_repository
74+
app_config: BasicMemoryConfig, project_repository, tmp_path
7575
):
7676
"""Without a --project constraint, every active project is watched."""
77+
# Use tmp_path so the project paths are OS-absolute on Windows too — a
78+
# POSIX-style "/tmp/alpha" is not absolute on Windows (no drive letter),
79+
# and _select_projects_to_watch now skips non-absolute paths (issue #949).
7780
await _register_local_projects(
7881
app_config,
7982
project_repository,
8083
[
81-
{"name": "project-alpha", "path": "/tmp/alpha"},
82-
{"name": "project-beta", "path": "/tmp/beta"},
84+
{"name": "project-alpha", "path": str(tmp_path / "alpha")},
85+
{"name": "project-beta", "path": str(tmp_path / "beta")},
8386
],
8487
)
8588

@@ -94,7 +97,7 @@ async def test_select_projects_to_watch_returns_all_when_unconstrained(
9497

9598
@pytest.mark.asyncio
9699
async def test_select_projects_to_watch_filters_to_constrained_project(
97-
app_config: BasicMemoryConfig, project_repository
100+
app_config: BasicMemoryConfig, project_repository, tmp_path
98101
):
99102
"""With ``constrained_project`` set, only that project is returned.
100103
@@ -106,8 +109,8 @@ async def test_select_projects_to_watch_filters_to_constrained_project(
106109
app_config,
107110
project_repository,
108111
[
109-
{"name": "project-alpha", "path": "/tmp/alpha"},
110-
{"name": "project-beta", "path": "/tmp/beta"},
112+
{"name": "project-alpha", "path": str(tmp_path / "alpha")},
113+
{"name": "project-beta", "path": str(tmp_path / "beta")},
111114
],
112115
)
113116

@@ -124,13 +127,13 @@ async def test_select_projects_to_watch_filters_to_constrained_project(
124127

125128
@pytest.mark.asyncio
126129
async def test_select_projects_to_watch_empty_when_constrained_project_missing(
127-
app_config: BasicMemoryConfig, project_repository
130+
app_config: BasicMemoryConfig, project_repository, tmp_path
128131
):
129132
"""An unknown constraint yields an empty watch set rather than watching everything."""
130133
await _register_local_projects(
131134
app_config,
132135
project_repository,
133-
[{"name": "project-alpha", "path": "/tmp/alpha"}],
136+
[{"name": "project-alpha", "path": str(tmp_path / "alpha")}],
134137
)
135138

136139
service = WatchService(

0 commit comments

Comments
 (0)