Hermetic systemd tests for non-systemd environments

NousResearch/hermes-agent · cluster 15187 · gateway

Data as of

Nothing open on GitHub. Fix merged in #61384. Check it covers your case.

The short answer

0open issues
0open PRs
6items grouped
Known?
Yes. 6 related items grouped here, 2 issues already closed.
Fix event
A fix was merged to main in PR #61384. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #61384. That is separate from the fix event.
Still open
Nothing open on GitHub.

These issues and PRs address gateway service refresh tests that fail in environments without systemd (e.g., containers or root contexts). The work involves mocking or bypassing the systemd D-Bus preflight check to make the tests self-contained and reliably runnable anywhere.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #61384 test(gateway): mock systemd preflight in service-refresh tests for non-systemd hosts (salvage #15435)

    merged to main

    files: tests/hermes_cli/test_gateway_service.py

    Show the diff
    • tests/hermes_cli/test_gateway_service.py
      @@ -68,6 +68,10 @@ def test_systemd_start_refreshes_outdated_unit(self, tmp_path, monkeypatch):
       
               monkeypatch.setattr(gateway_cli, "get_systemd_unit_path", lambda system=False: unit_path)
               monkeypatch.setattr(gateway_cli, "generate_systemd_unit", lambda system=False, run_as_user=None: "new unit\n")
      +        # Bypass systemd availability checks — this test targets unit-file
      +        # refresh logic, not D-Bus reachability (fails on macOS/WSL/Docker).
      +        monkeypatch.setattr(gateway_cli, "_preflight_user_systemd", lambda **kw: None)
      +        monkeypatch.setattr(gateway_cli, "_select_systemd_scope", lambda system=False: False)
       
               calls = []
       
      @@ -91,6 +95,10 @@ def test_systemd_restart_refreshes_outdated_unit(self, tmp_path, monkeypatch):
       
               monkeypatch.setattr(gateway_cli, "get_systemd_unit_path", lambda system=False: unit_path)
               monkeypatch.setattr(gateway_cli, "generate_systemd_unit", lambda system=False, run_as_user=None: "new unit\n")
      +        # Bypass systemd availability checks — this test targets unit-file
      +        # refresh logic, not D-Bus reachability (fails on macOS/WSL/Docker).
      +        monkeypatch.setattr(gateway_cli, "_preflight_user_systemd", lambda **kw: None)
      +        monkeypatch.setattr(gateway_cli, "_select_systemd_scope", lambda system=False: False)
       
               calls = []
               monkeypatch.setattr("gateway.status.get_running_pid", lambda: None)

3 PRs closed without merging

From the close comments: duplicate 1 · merged via another change 1 · other 1

  • #15190 test(gateway): make systemd refresh tests hermetic with user D-Bus preflight · other → #15254, #15243, #15244
  • #15435 fix(cli): mock systemd preflight in gateway service tests for non-systemd environments (#15187) · merged via another change → #61384
  • #23787 test(cli): keep systemd refresh unit tests hermetic after preflight (#15187) · duplicate → #15435, #15187
Closed issues · 2
  • Closed#15187[Bug]: test_gateway_service systemd refresh tests fail in non-systemd environments after user D-Bus preflight
  • Closed#18630Stabilize gateway service tests in container/root environments
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.29: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means 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 Lab

At a glance

Subsystem
gateway
Merged PRs
#61384
Closed issues
2
Attempts
3 PRs closed without merging
Fix link checked
9 Jul 2026

For your agent

The same facts, typed.