feat: support batch repetition and selective case import

This commit is contained in:
chenmingxuan committed 2026-10-09 16:29:16 +08:00
1 parent df66897ff4
commit 4d6560dbd4
16 files changed
+296 -37

No files matched your search

+8 -1
View File
@@ -30,6 +30,7 @@ class BatchRequest(ReportPreferences):
device_serial: str = Field(min_length=1, max_length=200)
profile: Literal["flash", "pro"] = "flash"
stop_on_failure: bool = False
repeat_count: int = Field(default=1, ge=1, strict=True)
timeout_seconds: int = Field(
default_factory=lambda: settings.ARTEMIS_TASK_TIMEOUT_SECONDS,
ge=30,
@@ -52,6 +53,7 @@ def preferences():
return {
**store.preferences(),
"batch_timeout_seconds": settings.ARTEMIS_TASK_TIMEOUT_SECONDS,
"batch_max_executions": settings.ARTEMIS_BATCH_MAX_EXECUTIONS,
}
@@ -256,7 +258,12 @@ def history(
[*args, size, (page - 1) * size],
).fetchall()
items = [dict(row) for row in rows]
jobs = store.jobs_for_sessions([item["session_id"] for item in items])
for item in items:
if item["case_id"]:
if job := jobs.get(item["session_id"]):
item["name"] = task_import.execution_title(job)
item["iteration"] = job.get("iteration", 1)
item["repeat_count"] = job.get("repeat_count", 1)
elif item["case_id"]:
item["name"] = task_import.case_title(item)
return {"items": items, "total": total, "page": page, "size": size}