feat(tester): support isolated full regression workflow
This commit is contained in:
@@ -103,6 +103,27 @@ def load_yaml_results(path: Path) -> list[dict[str, Any]]:
|
||||
errors.append(f"YAML testcase id 重复: {_format_ids(set(duplicates))}")
|
||||
if errors:
|
||||
raise SummaryError("YAML 校验失败:\n- " + "\n- ".join(errors))
|
||||
issues = data.get("defects", data.get("test_issues"))
|
||||
if issues is not None:
|
||||
if not isinstance(issues, list):
|
||||
raise SummaryError("YAML defects/test_issues 必须是列表")
|
||||
result_ids = set(ids)
|
||||
issue_errors: list[str] = []
|
||||
for index, issue in enumerate(issues, start=1):
|
||||
if not isinstance(issue, dict):
|
||||
issue_errors.append(f"YAML defects[{index}] 不是 mapping")
|
||||
continue
|
||||
testcase = str(issue.get("testcase") or "")
|
||||
issue_type = str(issue.get("issue_type") or "")
|
||||
if not testcase or testcase not in result_ids:
|
||||
issue_errors.append(f"YAML defects[{index}] testcase 无效: {testcase or '(missing)'}")
|
||||
if issue_type not in {"product", "test"}:
|
||||
issue_errors.append(f"YAML defects[{index}] issue_type 无效: {issue_type or '(missing)'}")
|
||||
for field in ("expected", "observed", "artifact_hash", "environment", "evidence_path", "reproduction", "next_step"):
|
||||
if field not in issue:
|
||||
issue_errors.append(f"YAML defects[{index}] 缺少 {field}")
|
||||
if issue_errors:
|
||||
raise SummaryError("YAML defects 校验失败:\n- " + "\n- ".join(issue_errors))
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user