Files
ecm_sync_system/tests/README.md
T
2026-03-09 16:47:25 +08:00

30 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 测试说明
## 目录结构
- `tests/unit/`:状态机运行时、策略辅助、工具链严格性、模块导入面等快速单元测试。
- `tests/integration/`copy pipeline、多节点 full pipeline、UI API 烟测、状态事件覆盖等集成测试。
- `tests/fixtures/``tests/mocks/`:可复用测试夹具与 Mock 数据源。
## 运行方式
- 全量:`pytest -q`
- 单元:`pytest tests/unit -q`
- 集成:`pytest tests/integration -q`
- 工具链专项:`pytest tests/integration/test_toolchain_config_and_graph.py -q`
- UI 专项:`pytest tests/integration/test_ui_api_smoke.py -q`
## 设计原则
- 不绕过 schema/状态机校验;配置错误必须显式失败。
- 单元测试聚焦纯逻辑,集成测试覆盖流水线与边界行为。
- 所有测试均从仓库根路径解析配置,避免目录迁移导致路径脆弱。
- 保留高价值回归测试,移除仅重复路径或无断言价值的历史脚本型测试(脚本保留在 `scripts/`,不纳入 pytest)。
## 质量目标
- 覆盖 `sync_state_machine` 主模块导入面,尽早发现模块级破坏。
- 覆盖状态机配置校验与渲染工具链。
- 覆盖 UI 基础 API 健康检查。
- 覆盖核心业务链路(bind/create/update 与 full pipeline)。
## 大规模自动回归
- 按轮迭代的大规模自动测试方法见 [auto_test_spec/agent_auto_test_method.md](auto_test_spec/agent_auto_test_method.md)。
- 执行时优先采用“单 domain 复现 -> 修复/分类 -> 全量聚合回归 -> 记录总计变化”的节奏,避免一次携带过多上下文。