[质量] 后端单元测试覆盖率提升至 80%+ #29

Closed
opened 2026-05-05 01:01:47 +08:00 by admin · 0 comments
Owner

背景

当前后端有 pytest 框架和少量测试(tests/ 目录),但覆盖率低,重构和发布缺乏信心。

需求

  1. 核心模块优先:agent_runtime/core.py、api/agent_chat.py、api/agents.py
  2. Mock 外部依赖(LLM API、数据库 Session)
  3. 参数化测试覆盖边界条件
  4. CI 中强制覆盖率门禁(< 80% 不允许合并)

涉及目录

  • backend/tests/

优先级

中 — 质量基础建设

## 背景 当前后端有 pytest 框架和少量测试(tests/ 目录),但覆盖率低,重构和发布缺乏信心。 ## 需求 1. 核心模块优先:agent_runtime/core.py、api/agent_chat.py、api/agents.py 2. Mock 外部依赖(LLM API、数据库 Session) 3. 参数化测试覆盖边界条件 4. CI 中强制覆盖率门禁(< 80% 不允许合并) ## 涉及目录 - backend/tests/ ## 优先级 中 — 质量基础建设
admin self-assigned this 2026-05-05 01:01:47 +08:00
admin closed this issue 2026-05-10 14:42:32 +08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/aiagent#29