feat: 自动化增加起止时间 + 本轮每次测试明细表

- 显示自动化开始/结束时间
- 测试信息区新增本轮测试明细表(序号、状态、关键字段)
- 方便对照平均值是否计算正确
This commit is contained in:
wangfq
2026-05-28 15:19:20 +08:00
parent dee27eb3be
commit 60215eef48
4 changed files with 84 additions and 0 deletions
+21
View File
@@ -251,6 +251,27 @@ def get_automation_averages(dnt_id: int, since: str = None) -> dict:
return {}
def get_automation_records(dnt_id: int, since: str) -> list[dict]:
"""获取本轮自动化测试的所有记录(含 serialnet 状态)"""
conn = get_conn()
try:
with conn.cursor() as cur:
cur.execute(
"SELECT t.*, sn.state as sn_state "
"FROM tb_state_tst t "
"LEFT JOIN tb_serialnet sn ON sn.dnt_id = t.dnt_id "
" AND sn.state IN (2,3) "
" AND sn.update_time >= t.create_time "
" AND sn.update_time < DATE_ADD(t.create_time, INTERVAL 1 SECOND) "
"WHERE t.dnt_id=%s AND t.create_time >= %s "
"ORDER BY t.id ASC",
(dnt_id, since),
)
return cur.fetchall()
finally:
conn.close()
# ─── 用户管理 ──────────────────────────────────────────────────────
def get_user_by_username(username: str) -> dict | None: