---
name: test-report-format
description: 后端集成测试报告的格式要求和模板。
---

# 测试报告格式

## 路径

`testing/reports/{module}-{YYYY-MM-DD}-integration-report.md`

## 报告结构

```markdown
# {模块名} 后端集成测试报告

## 概要
- 日期 / 分支 / 环境 / 执行命令
- 总数 / 通过 / 失败 / 跳过 / 通过率

## 覆盖率
- In-scope 端点数（来自 07-api.md）
- 已覆盖端点数
- 覆盖率百分比
- 未覆盖端点列表（如有）

## 失败用例（仅失败时填写）
每个失败用例：
- 端点：METHOD /path
- 期望 vs 实际
- 原因分析
- 是否阻断

## 发现的问题
- Bug 清单（编号、严重度、描述、影响）

## 已知限制
- 跳过的用例及原因
- 环境限制
```

## 不需要写的

- 不需要逐用例列出通过的用例明细（Jest 输出已有）
- 不需要重复阶段一的契约一致性检查结果（已在代码修复中解决）

## 自动化报告脚本（可选）

```bash
python .agents/skills/test-backend/scripts/generate_backend_test_report.py \
  --module performance \
  --type integration \
  --test-file testing/backend/integration/performance/performance.api.test.ts \
  --api-doc docs/modules/performance/07-api.md \
  --jest-json testing/reports/jest-results.json \
  --command "npm run test:backend:integration -- --json --outputFile testing/reports/jest-results.json"
```
