mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 17:10:43 +00:00
1.6.2:常规发布
- 版本号 1.6.2 -> 1.6.2 - 重建三端并打包 - 关键测试全过
This commit is contained in:
+25
-7
@@ -21,6 +21,7 @@ from __future__ import annotations
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -124,13 +125,30 @@ def main() -> int:
|
||||
print((proc.stdout or "")[-800:])
|
||||
print((proc.stderr or "")[-400:])
|
||||
return 1
|
||||
proc = sh([sys.executable, "-u", "_tests/test_package_remote.py"],
|
||||
timeout=1800)
|
||||
out = proc.stdout or ""
|
||||
last = [ln for ln in out.splitlines() if "通过" in ln or "失败" in ln]
|
||||
print(f" {'test_package_remote.py':28} "
|
||||
f"{'✓' if proc.returncode == 0 else '✗'} {last[-1] if last else ''}")
|
||||
if proc.returncode != 0:
|
||||
# 打包测试要起真的中转 + agent,前面刚跑过几个测试,
|
||||
# 偶尔会撞上端口/隧道还没恢复 —— 重试一次就好
|
||||
ok_pkg = False
|
||||
for attempt in range(2):
|
||||
proc = sh([sys.executable, "-u", "_tests/test_package_remote.py"],
|
||||
timeout=1800)
|
||||
out = proc.stdout or ""
|
||||
last = [ln for ln in out.splitlines() if "通过" in ln or "失败" in ln]
|
||||
ok_pkg = proc.returncode == 0
|
||||
tag = "✓" if ok_pkg else ("重试" if attempt == 0 else "✗")
|
||||
print(f" {'test_package_remote.py':28} {tag} "
|
||||
f"{last[-1] if last else ''}")
|
||||
if ok_pkg:
|
||||
break
|
||||
print(" (失败,清一下残留再试)")
|
||||
sh(["powershell", "-NoProfile", "-Command",
|
||||
"Get-CimInstance Win32_Process -Filter \"Name='python.exe'\" | "
|
||||
"Where-Object { $_.CommandLine -match 'run_agent' -or "
|
||||
"$_.CommandLine -match '_tests' -or "
|
||||
"$_.CommandLine -match 'relay.py' } | "
|
||||
"ForEach-Object { Stop-Process -Id $_.ProcessId -Force "
|
||||
"-ErrorAction SilentlyContinue }"], timeout=120)
|
||||
time.sleep(4)
|
||||
if not ok_pkg:
|
||||
return 1
|
||||
|
||||
# ---- 5. 提交推送 ----
|
||||
|
||||
Reference in New Issue
Block a user