fix(deployer): align stale test contracts

This commit is contained in:
2026-10-14 12:21:09 +08:00
parent 8d48d2d335
commit fbf0ca8cd8
2 changed files with 12 additions and 4 deletions
+5 -2
View File
@@ -67,8 +67,11 @@ class DeployerCheckTests(unittest.TestCase):
self.assertIn("不要读 compose.md", compose_section)
self.assertIn("remote.py <svc> recreate", compose_section)
self.assertIn("一句问", compose_section)
self.assertIn("没有 `test` 就用非 `prod` 的那个", compose_section)
self.assertIn("不要** `sync.py` / `remote.py`", compose_section)
self.assertIn(
"没有 `test` 时只能选择明确为本机的非 `prod` 环境",
compose_section,
)
self.assertIn("不要 `sync.py`、`remote.py`、SSH", compose_section)
self.assertIn("docker compose up -d --force-recreate", compose_section)
self.assertNotIn(
"读 [compose.md](references/compose.md)。用 `list.py` 摸底",
+7 -2
View File
@@ -25,6 +25,7 @@ sync_spec.loader.exec_module(deployer_sync)
def _info(service_dir: str, **overrides) -> dict:
info = {
"service_dir": service_dir,
"name": "demo-service",
"node": "edge",
"remote_dir": "/opt/app/svc",
"sync_exclude": ["data", "_data"],
@@ -93,11 +94,15 @@ class DeployerSyncTests(unittest.TestCase):
self.assertEqual(rc, 0)
self.assertTrue(commands)
mkdir_cmd = commands[0]
mkdir_cmd = next(
command
for command in commands
if command and command[0] == "ssh" and command[-1].startswith("mkdir -p ")
)
self.assertEqual(mkdir_cmd[0], "ssh")
self.assertIn("-p", mkdir_cmd)
self.assertIn("2222", mkdir_cmd)
self.assertTrue(any("/opt/app/svc/cfg" in part for part in mkdir_cmd))
self.assertIn("/opt/app/svc/cfg", " ".join(mkdir_cmd))
scp_cmds = [c for c in commands if c and c[0] == "scp"]
self.assertEqual(len(scp_cmds), 2)