fix(photon): correct gateway start command (#45566)

This commit is contained in:
Teknium
2026-06-13 05:14:59 -07:00
committed by GitHub
parent fa2aba90b4
commit 2681c5a12d
7 changed files with 87 additions and 3 deletions
+14
View File
@@ -274,6 +274,20 @@ def test_gateway_start_in_container_with_operational_systemd_uses_systemd(monkey
assert calls == [False]
def test_gateway_start_ignores_legacy_platform_selector(monkeypatch):
monkeypatch.setattr(gateway, "supports_systemd_services", lambda: True)
monkeypatch.setattr(gateway, "is_wsl", lambda: False)
monkeypatch.setattr(gateway, "is_macos", lambda: False)
calls = []
monkeypatch.setattr(gateway, "systemd_start", lambda system=False: calls.append(system))
args = SimpleNamespace(gateway_command="start", system=False, all=False, platform="photon")
gateway.gateway_command(args)
assert calls == [False]
def test_gateway_restart_on_windows_without_service_uses_detached_backend(monkeypatch):
"""Windows manual restart must not fall back to foreground run_gateway().
@@ -81,3 +81,12 @@ def test_gateway_accept_hooks_flag():
p = _gateway_parser()
ns = p.parse_args(["gateway", "run", "--accept-hooks"])
assert ns.accept_hooks is True
def test_gateway_lifecycle_accepts_legacy_platform_flag():
p = _gateway_parser()
for action in ("start", "restart", "status"):
ns = p.parse_args(["gateway", action, "--platform", "photon"])
assert ns.gateway_command == action
assert ns.platform == "photon"
assert ns.func is _h_gateway