Skip to content

The agent that grows with you

test(cli): launchd fleet tests run on the real host, hermetic to a live fleet

teknium110faa3d7c73f
diff --git a/tests/ci/test_list_os_marked_tests.py b/tests/ci/test_list_os_marked_tests.py
index 5404fdd211d..9b44a7596c9 100644
--- a/tests/ci/test_list_os_marked_tests.py
+++ b/tests/ci/test_list_os_marked_tests.py
@@ -134,11 +134,3 @@ def test_real_tree_selects_files_for_every_marker():
assert listed, f"{marker} selected no files"
for rel in listed:
assert (REPO_ROOT / rel).is_file(), f"{marker} listed missing {rel}"
-
-
-def test_macos_marker_selects_launchd_fleet_restart_coverage():
- """The macOS lane must import the launchd-specific update regression."""
- result = _run("macos_only")
-
- assert result.returncode == 0, result.stderr
- assert "tests/hermes_cli/test_update_launchd_fleet_restart.py" in result.stdout.split()
diff --git a/tests/hermes_cli/test_update_launchd_fleet_restart.py b/tests/hermes_cli/test_update_launchd_fleet_restart.py
index 6b41af21ad1..550bf4090aa 100644
--- a/tests/hermes_cli/test_update_launchd_fleet_restart.py
+++ b/tests/hermes_cli/test_update_launchd_fleet_restart.py
@@ -39,13 +39,7 @@ from hermes_cli.update_cmd import (
)
-pytestmark = [
- pytest.mark.macos_only,
- pytest.mark.skipif(
- sys.platform == "win32",
- reason="launchd fleet restart is macOS-only; helpers use POSIX os.getuid",
- ),
-]
+pytestmark = pytest.mark.macos_only # launchd fleet restart is macOS-only; helpers use POSIX os.getuid
UID = 501
@@ -200,8 +194,10 @@ class TestProbeLaunchdDomainForLabel:
class TestGetServicePidsScoping:
def _wire(self, monkeypatch):
- monkeypatch.setattr(gw, "is_macos", lambda: True)
monkeypatch.setattr(gw, "supports_systemd_services", lambda: False)
+ # The all_profiles branch also runs a real ``launchctl list`` prefix scan; a developer
+ # box with a live ai.hermes.gateway* fleet would leak its PIDs into the assertion.
+ monkeypatch.setattr(gw.subprocess, "run", lambda *a, **k: _completed(0, ""))
monkeypatch.setattr(gw, "get_launchd_label", lambda: "ai.hermes.gateway")
monkeypatch.setattr(
gw,