Files
hermes-agent/tests/hermes_cli/test_update_fleet_incomplete_warning.py
ethernet 071ccfbcdf test: restore platforms() host gating that merges reverted to the legacy trio
Four origin/main merges brought back `linux_only` / `macos_only` /
`windows_only` marks in 41 test files, along with the pre-platforms()
versions of scripts/ci/list_os_marked_tests.py and check_os_marker_fakes.py.
Because the legacy names are no longer registered, pytest treated them as
unknown marks — a warning — so every Windows- or macOS-only test RAN on
Linux (test_local_runtime_recovery.py tripped the live-system kill guard).

Rewrite the marks, restore the platforms()-aware CI scripts (keeping main's
os.walk fix for vanishing __pycache__ dirs), drop the stale _BASELINE entries,
and make the conftest reject the retired marks outright so the next merge
cannot resurrect them silently.
2026-09-18 19:06:52 -04:00

28 lines
1007 B
Python

"""Incomplete-fleet-restart hint on a systemd host (Linux arm of
``_warn_incomplete_gateway_fleet_restart``; the macOS arm lives in
test_update_launchd_fleet_restart.py). Regression for #111866: this class used to
sit in the launchd file, where it asserted the non-macOS branch under a faked
``is_macos()`` — green on Linux, never run on macOS, wrong on both."""
from __future__ import annotations
import pytest
from hermes_cli.update_cmd_fleet import _warn_incomplete_gateway_fleet_restart
pytestmark = pytest.mark.platforms("linux")
def test_launchd_labels_get_launchctl_hint(capsys):
_warn_incomplete_gateway_fleet_restart(["ai.hermes.gateway-merit-ops"])
out = capsys.readouterr().out
assert "Update incomplete" in out
assert "launchctl kickstart -k" in out
def test_systemd_units_keep_systemctl_hint(capsys):
_warn_incomplete_gateway_fleet_restart(["hermes-gateway-coder"])
out = capsys.readouterr().out
assert "systemctl" in out
assert "launchctl" not in out