From d11e571c5b6c24b586ef5b8fb2cfcf6a6bfa6d6d Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 4 Sep 2026 02:20:57 +0200 Subject: test(node): make the suite pass on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `.read_text()` on source files now `encoding="utf-8"` — cp1252 chokes on the em dashes / box-drawing chars those files contain. - test node.toml templates embed paths via `Path.as_posix()`: a raw Windows path in a basic TOML string is a parse error (`\U`, `\a`, ... are escapes). - new `test_platform.py` covers `meshbay_node.platform` by mocking `sys.platform` / `os.environ` — runs on both OSes. - `skipif(sys.platform == "win32")`, in `conftest.needs_subprocess` and inline, for the documented gaps: ffmpeg/ffprobe via asyncio subprocess (the win32 selector loop, forced for aiortc, cannot spawn one), the systemd `reload`/`restart-daemon` delegation (Windows path is W3), the keystore `st_mode == 600` assertion (NTFS ignores mode bits), and the symlink-escape test (needs Developer Mode). Windows: 781 passed, 25 skipped. No change on Linux. Co-Authored-By: Claude Sonnet 5 --- .../meshbay-node/tests/test_hot_reload_survives_client_close.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages/meshbay-node/tests/test_hot_reload_survives_client_close.py') diff --git a/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py b/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py index 7cb74cb..fc6af70 100644 --- a/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py +++ b/packages/meshbay-node/tests/test_hot_reload_survives_client_close.py @@ -17,6 +17,7 @@ finished and the new group became available on its own. import asyncio import base64 import os +from pathlib import Path import pytest from cryptography.hazmat.primitives import serialization @@ -45,8 +46,10 @@ def _toml(data_dir, first_group_dir, second_group_id=None, second_group_dir=None # (~/.local/share/meshbay) instead of erroring, which is exactly how this # test once ran a whole daemon — including _shutdown()'s unlink of # ui-token — against the developer's real, already-running node. + # Forward slashes: a raw Windows path in a basic TOML string is a parse + # error (`\U`, `\a`, ... are escape sequences). pathlib reads `/` fine. text = f""" -data_dir = "{data_dir}" +data_dir = "{Path(data_dir).as_posix()}" [hub] url = "http://localhost:9999" @@ -59,7 +62,7 @@ ui_port = {_free_port()} [[groups]] id = "{"a" * 32}" name = "first" -shared_dir = "{first_group_dir}" +shared_dir = "{Path(first_group_dir).as_posix()}" visibility = "private" """ if second_group_id: @@ -67,7 +70,7 @@ visibility = "private" [[groups]] id = "{second_group_id}" name = "slow-new-group" -shared_dir = "{second_group_dir}" +shared_dir = "{Path(second_group_dir).as_posix()}" visibility = "private" """ return text -- cgit v1.2.3