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.
This commit is contained in:
host committed 2026-10-26 03:00:30 +08:00
1 parent 50bc03cd51
commit 19cf44551a
1 file changed
+4
+4
View File
@@ -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")