Skip to content

The agent that grows with you

fix(tests): skip POSIX-only and symlink tests on Windows CI

ColrWei80ea4cbde0c1
diff --git a/tests/test_atomic_replace_symlinks.py b/tests/test_atomic_replace_symlinks.py
index 42c85568892..797d2b3a12d 100644
--- a/tests/test_atomic_replace_symlinks.py
+++ b/tests/test_atomic_replace_symlinks.py
@@ -224,6 +224,7 @@ def test_atomic_replace_broken_symlink_creates_target(tmp_path: Path) -> None:
def test_atomic_replace_copy_fallback_preserves_symlink(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
@@ -506,6 +507,7 @@ def test_in_place_rewrite_never_exposes_a_truncated_file(
assert observed == [5000]
def test_symlinked_target_survives_a_contended_rename(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, fast_replace_retries: None
) -> None:
diff --git a/tests/test_hermes_bootstrap.py b/tests/test_hermes_bootstrap.py
index b95b50d9ad0..a97b05d1282 100644
--- a/tests/test_hermes_bootstrap.py
+++ b/tests/test_hermes_bootstrap.py
@@ -120,6 +120,7 @@ class TestUserOptOut:
class TestPosixNoOp:
"""POSIX: zero behavior change. We don't touch LANG, LC_*, or any
stdio. The goal is that Linux/macOS behave identically before and
@@ -336,6 +337,7 @@ class TestHardenImportPath:
class TestSuppressPlatformVerConsole:
"""suppress_platform_ver_console: stub applied on Windows, no-op on POSIX."""
+ @pytest.mark.linux_only
def test_noop_on_posix(self):
import platform
hb = _fresh_import()
diff --git a/tests/test_hermes_constants.py b/tests/test_hermes_constants.py
index 86684fc0ea1..093bc9ad60f 100644
--- a/tests/test_hermes_constants.py
+++ b/tests/test_hermes_constants.py
@@ -33,6 +33,7 @@ from hermes_constants import (
class TestGetDefaultHermesRoot:
"""Tests for get_default_hermes_root() — Docker/custom deployment awareness."""
+ @pytest.mark.linux_only
def test_no_hermes_home_returns_native(self, tmp_path, monkeypatch):
"""When HERMES_HOME is not set, returns ~/.hermes."""
monkeypatch.delenv("HERMES_HOME", raising=False)
@@ -759,7 +760,10 @@ class TestGetHermesDir:
"""
self._set_home(tmp_path, monkeypatch)
legacy = tmp_path / "pairing"
- legacy.symlink_to(tmp_path / "does-not-exist")
+ try:
+ legacy.symlink_to(tmp_path / "does-not-exist")
+ except (OSError, NotImplementedError) as exc:
+ pytest.skip(f"Symlink not supported on this platform/permission: {exc}")
new = tmp_path / "platforms" / "pairing"
new.mkdir(parents=True)
(new / "discord-approved.json").write_text("[]")
@@ -773,7 +777,10 @@ class TestGetHermesDir:
real.mkdir()
(real / "cached.png").write_bytes(b"x")
legacy = tmp_path / "image_cache"
- legacy.symlink_to(real)
+ try:
+ legacy.symlink_to(real)
+ except (OSError, NotImplementedError) as exc:
+ pytest.skip(f"Symlink not supported on this platform/permission: {exc}")
result = get_hermes_dir("cache/images", "image_cache")
assert result == legacy