mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(tests): two more container-env parity pins in gateway service tests
- test_supports_systemd_services_returns_true_when_systemctl_present: pin is_container=False (host contract; CI runner pods are containers) - test_systemd_restart_gracefully_restarts_running_service_and_waits: stub _preflight_user_systemd — no user D-Bus in runner pods; the test asserts restart choreography, not D-Bus reachability
This commit is contained in:
parent
ede14b2426
commit
2b3fedacbb
1 changed files with 6 additions and 0 deletions
|
|
@ -460,6 +460,8 @@ class TestGatewayServiceDetection:
|
|||
monkeypatch.setattr(gateway_cli, "is_linux", lambda: True)
|
||||
monkeypatch.setattr(gateway_cli, "is_termux", lambda: False)
|
||||
monkeypatch.setattr(gateway_cli, "is_wsl", lambda: False)
|
||||
# CI runner pods are containers; pin the host case this test covers.
|
||||
monkeypatch.setattr(gateway_cli, "is_container", lambda: False)
|
||||
monkeypatch.setattr(gateway_cli.shutil, "which", lambda name: "/usr/bin/systemctl")
|
||||
|
||||
assert gateway_cli.supports_systemd_services() is True
|
||||
|
|
@ -495,6 +497,10 @@ class TestGatewaySystemServiceRouting:
|
|||
|
||||
monkeypatch.setattr(gateway_cli, "_select_systemd_scope", lambda system=False: False)
|
||||
monkeypatch.setattr(gateway_cli, "_require_service_installed", lambda action, system=False: None)
|
||||
# Preflight probes the real user D-Bus; on CI runner pods there is
|
||||
# none and it raises UserSystemdUnavailableError. Stub it — this
|
||||
# test asserts the restart choreography, not D-Bus reachability.
|
||||
monkeypatch.setattr(gateway_cli, "_preflight_user_systemd", lambda: None)
|
||||
monkeypatch.setattr(gateway_cli, "refresh_systemd_unit_if_needed", lambda system=False: calls.append(("refresh", system)))
|
||||
monkeypatch.setattr(gateway_cli, "_get_restart_drain_timeout", lambda: 12.0)
|
||||
monkeypatch.setattr(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue