diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 39d3c6f8..525c58cd 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -786,6 +786,7 @@ jobs: export GIT_CONFIG_VALUE_3="ssh://git@gitea.naitangbaobao.cn:52222/weichen/" export GIT_CONFIG_KEY_4="core.hooksPath" export GIT_CONFIG_VALUE_4="/dev/null" + export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10" git config --global --unset-all "http.$SERVER/.extraheader" 2>/dev/null || true git config --global --add "http.$SERVER/.extraheader" "AUTHORIZATION: token $SUBMODULE_TOKEN" git config --global --unset-all "url.$SERVER/weichen/.insteadOf" 2>/dev/null || true diff --git a/tests/test_svc_realcombo.py b/tests/test_svc_realcombo.py index 9e01c195..ef56efdb 100644 --- a/tests/test_svc_realcombo.py +++ b/tests/test_svc_realcombo.py @@ -78,6 +78,15 @@ class RealComboTests(tsr.SvcAutoRecoverTests): self.assertTrue(self.real_bin.is_file() and os.access(self.real_bin, os.X_OK), "SVC_REAL_BIN 不可执行:%s" % self.real_bin) + def svc(self, *args, check=True, env=None, timeout=120): + proc = subprocess.run( + ["bash", str(self.root / "scripts" / "svc.sh"), *map(str, args)], + cwd=self.root, env=env if env is not None else self.env, text=True, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=timeout) + if check: + self.assertEqual(proc.returncode, 0, proc.stdout) + return proc + def manifest(self, name): p = self.runtime(name) / "manifest.json" return json.loads(p.read_text(encoding="utf-8")) if p.exists() else None @@ -244,7 +253,7 @@ class RealComboTests(tsr.SvcAutoRecoverTests): "SVC_RDM_ORIGIN": RDM_ORIGIN}) agent_port = free_test_port() result = self.svc("rcf", "deploy", "--from", "rdm", "--port", str(agent_port), - env=env, check=False) + env=env, check=False, timeout=300) if result.returncode != 0: log = self.runtime("rcf") / "svc.log" tail = log.read_text(encoding="utf-8", errors="replace")[-2000:] \