Adding Windows platform guards for UNIX-only test imports
NousResearch/hermes-agent · cluster 22420 · hermes cli
Data as of
Nothing open on GitHub. Fix merged in #22683. Check it covers your case.
The short answer
- Known?
- Yes. 9 related items grouped here, 2 issues already closed.
- Fix event
- A fix was merged to main in PR #22683. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
partially resolved, deciding PR #22683. That is separate from the fix event. - Still open
- Nothing open on GitHub.
Multiple issues and PRs addressing missing platform guards for UNIX-only stdlib modules (pwd, fcntl, grp) in test files, which cause failures on Windows. Proposed fixes use pytest.importorskip or skip decorators at the module level.
Open issues0
Open PRs0
Fixes on record
-
#22683 tests: add Windows skip guards for UNIX-only stdlib imports (salvage #22567)
files:
scripts/release.py,tests/hermes_cli/test_gateway_service.py,tests/tools/test_file_sync_back.pyShow the diff
-
scripts/release.py@@ -67,6 +67,7 @@ "[redacted:email]": "wesleysimplicio", "[redacted:email]": "SiliconID", "[redacted:email]": "xieNniu", + "[redacted:email]": "wali-reheman", "[redacted:email]": "uzunkuyruk", "[redacted:email]": "Zhekinmaksim", "[redacted:email]": "KvnGz", -
tests/hermes_cli/test_gateway_service.py@@ -1,13 +1,14 @@ """Tests for gateway service management helpers.""" import os -import pwd import subprocess from pathlib import Path from types import SimpleNamespace import pytest +pwd = pytest.importorskip("pwd") + import hermes_cli.gateway as gateway_cli from gateway import status from gateway.restart import ( @@ -1284,20 +1285,17 @@ class TestSystemServiceIdentityRootHandling: def test_auto_detected_root_is_rejected(self, monkeypatch): """When root is auto-detected (not explicitly requested), raise.""" - import pwd import grp monkeypatch.delenv("SUDO_USER", raising=False) monkeypatch.setenv("USER", "root") monkeypatch.setenv("LOGNAME", "root") - import pytest with pytest.raises(ValueError, match="pass --run-as-user root to override"): gateway_cli._system_service_identity(run_as_user=None) def test_explicit_root_is_allowed(self, monkeypatch): """When root is explicitly passed via --run-as-user root, allow it.""" - import pwd import grp root_info = pwd.getpwnam("root") @@ -1309,7 +1307,6 @@ def test_explicit_root_is_allowed(self, monkeypatch): def test_non_root_user_passes_through(self, monkeypatch): """Normal non-root user works as before.""" - import pwd import grp monkeypatch.delenv("SUDO_USER", raising=False) -
tests/tools/test_file_sync_back.py@@ -1,6 +1,5 @@ """Tests for FileSyncManager.sync_back() — pull remote changes to host.""" -import fcntl import io import logging import os @@ -12,6 +11,8 @@ import pytest +fcntl = pytest.importorskip("fcntl") + from tools.environments.file_sync import ( FileSyncManager, _sha256_file,
-
6 PRs closed without merging
From the close comments: done elsewhere 2 · duplicate 2 · merged via another change 1 · superseded by another PR 1
-
#22442 fix(tests): skip pwd/fcntl-dependent suites on Windows via importorskip · done elsewhere →
369cee0,4e8b857,b959cfa,#22683 -
#22447 fix(tests): add Windows skip guards for UNIX-only pwd/fcntl imports · duplicate →
#22683 -
#22567 tests: add Windows skip guards for UNIX-only stdlib imports · merged via another change →
#22683 -
#24551 test: guard bare import grp with pytest.importorskip at module level · done elsewhere →
4a4b9bd -
#24560 test: guard bare import grp with module-level pytest.importorskip · superseded by another PR →
#24551,#24531
Show 1 more
-
#24570 fix: add platform guard for grp import in test_gateway_service.py · duplicate →
#24551,#24531
Closed issues · 2
How this cluster was grouped
-
Link evidence (
partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text. - Members outside that structural core may belong to a different underlying problem.
-
Pairwise link density
0.20: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- hermes cli
- Merged PRs
- #22683
- Closed issues
- 2
- Attempts
- 6 PRs closed without merging
- Fix link checked
- 9 May 2026