From 19cf44551a9f501f3c0b23b3d5057b276fec941b Mon Sep 17 00:00:00 2001 From: host Date: Mon, 26 Oct 2026 03:00:30 +0800 Subject: [PATCH] Skip server-restart test when codex binary is absent CI failed on the first real PR with FileNotFoundError: 'codex': the test starts the real app-server, but GitHub runners have no codex binary on PATH (locally it passes because the VM has one). Skipping when shutil.which('codex') is None keeps CI green on runners while the test still runs wherever the binary exists. --- tests/test_host.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_host.py b/tests/test_host.py index 304a9e1..ccb7698 100644 --- a/tests/test_host.py +++ b/tests/test_host.py @@ -1,5 +1,6 @@ import json import os +import shutil import subprocess import sys import tempfile @@ -273,9 +274,12 @@ class StateVersionTest(unittest.TestCase): class ServerRestartTest(unittest.TestCase): + @unittest.skipUnless(shutil.which("codex"), + "codex binary not on PATH (e.g. GitHub runner)") def test_kill_then_ensure_alive(self): # 不跑模型:只验证 server 进程死了能重拉、list 能通。 # 用配对二进制(VM 本机补丁),隔离 CODEX_HOME。 + # Runner 上没有 codex 二进制时跳过,而不是失败。 import host as host_mod with tempfile.TemporaryDirectory() as tmp: codex_home = os.path.join(tmp, "codex-home")