Files
Nexus/tests/test_agent_deploy.py
T
Nexus Agent 863e49e518 feat(ops): prod timezone probe, web/app container sync, and D-01 agent upgrade.
Unify upgrade-agent with install.sh via agent_deploy; auto-sync Git web/app after
Docker upgrade to prevent vite hash drift; extend prod_probe for Beijing TZ checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 07:12:38 +08:00

31 lines
921 B
Python

"""Agent upgrade shell fragments stay aligned with install.sh."""
from server.utils.agent_deploy import (
AGENT_INSTALL_DIR,
AGENT_PIP_PACKAGES,
agent_kill_port_cmd,
build_agent_upgrade_cmd,
)
def test_pip_packages_match_install_sh_versions():
joined = " ".join(AGENT_PIP_PACKAGES)
assert "fastapi==0.115.6" in joined
assert "uvicorn==0.34.0" in joined
assert "httpx==0.28.1" in joined
assert "python-multipart==0.0.19" in joined
def test_upgrade_cmd_uses_install_dir_and_port():
cmd = build_agent_upgrade_cmd(
base_url="https://api.example.com",
ssh_user="deploy",
install_dir=AGENT_INSTALL_DIR,
agent_port=8602,
)
assert "/opt/nexus-agent/.venv/bin/python" in cmd
assert "heartbeat_policy.py" in cmd
assert agent_kill_port_cmd(8602) in cmd
assert "upgrade_ok" in cmd
assert "sudo systemctl restart nexus-agent" in cmd