feat: 测试开发学习路径上线阶段 3 前两个模块(26 章 / 120 小节)

- 新增模块 s3-01-platform-arch《测试平台架构与技术选型》:痛点排序、能力地图与范围裁剪、
  用户与角色、四层架构、执行层与 Agent、Go 选型与 ADR、前端协作约定、11 张表的数据模型、
  接口契约与幂等、CI/CD 边界与反模式、设计文档实操、速查表、自测。
- 新增模块 s3-02-platform-backend《平台后端开发:Go(Gin)与工程实践》:cmd/internal 骨架、
  路由分组与统一错误响应、中间件链、binding 校验、GORM/sqlc 与迁移事务、JWT 与 RBAC 审计、
  wire 依赖注入、asynq 任务状态机与幂等、执行引擎与 SSE 回传、工程质量与优雅退出、
  最小可用版实操、速查表、自测。
- modules-plan.json 登记阶段 3 全部 4 个模块(后两个仍为「筹备中」,编号与 STAGES 对齐)。
- index.html 的 PAGES 登记 s3-0 / s3-1 路由;模块 2 的「下一模块」指向筹备中的前端模块。
- glossary.json 补阶段 3 平台命名(qa/tdplat、tp_* 11 张表、三套状态、角色与错误码分段),
  并新增 tdplatform/test_case/run_record 等漂移正则与平台时间字段 *_time 规则。
- 顺带统一 s0-04 的 updated_at 为 update_time,全站时间字段口径一致。
- README 更新进度表、阶段 3 模块表、目录树、平台命名表与篇幅口径(3600–4800 字)。

自检:check-chapter --strict 26 页通过;check-pages 219 页全部通过;
check-glossary 218 页无漂移;add-back-links 补挂 16 页;check-portal 全部通过。
This commit is contained in:
2026-10-16 21:34:26 +08:00
parent 5222c1564d
commit 46af4a1e0e
35 changed files with 14620 additions and 10 deletions

View File

@@ -33,7 +33,33 @@
"Go": {
"示例服务 module": "mall(多包服务示例,如 mall/internal/order)",
"CLI 交付物 module": "qa/tdcheck",
"阶段 2 自动化仓库": "qa/tdauto(接口自动化框架)、qa/tdui(UI 自动化)、qa/tdmobile(移动端与小程序自动化)、qa/tdrun(阶段 2 收口的统一入口,Go 单二进制)"
"阶段 2 自动化仓库": "qa/tdauto(接口自动化框架)、qa/tdui(UI 自动化)、qa/tdmobile(移动端与小程序自动化)、qa/tdrun(阶段 2 收口的统一入口,Go 单二进制)",
"阶段 3 平台仓库": "qa/tdplat(测试平台后端,Go module 同名)、qa/tdplat-web(平台前端)"
},
"阶段 3 平台(qa/tdplat)": {
"表": {
"tp_user": "平台用户:id, username, password_hash, role, status, create_time",
"tp_env": "环境:env_id, env_name, base_url, config_json, create_time",
"tp_case": "用例:case_id, case_no, name, owner, env_id, priority, tags, status, create_time, update_time",
"tp_case_step": "用例步骤:step_id, case_id, seq, action, target, params_json, expect_json(步骤一定要拆行,不许塞进 tp_case 的大 JSON 列)",
"tp_suite": "套件:suite_id, name, owner, env_id, cron, case_count, create_time, update_time",
"tp_suite_case": "套件与用例关联:suite_id, case_id, seq, add_time",
"tp_task": "任务:task_id, task_no, suite_id, trigger_type, env_id, status, creator, create_time, start_time, finish_time",
"tp_run": "执行记录:run_id, task_id, agent_id, status, total, passed, failed, skipped, start_time, finish_time, report_path",
"tp_run_item": "结果明细:item_id, run_id, case_id, status, duration_ms, message, log_path, screenshot_path",
"tp_agent": "执行节点:agent_id, host, labels, status, last_heartbeat",
"tp_audit_log": "审计日志:id, user_id, action, target_type, target_id, detail, ip, create_time"
},
"时间字段": "平台表统一用 *_time:create_time / update_time / start_time / finish_time / add_time / archive_time",
"状态取值": {
"tp_task.status": "10 待执行 / 20 执行中 / 30 成功 / 40 失败 / 50 已取消",
"tp_run.status": "10 运行中 / 20 成功 / 30 失败 / 40 部分成功 / 50 已取消",
"tp_run_item.status": "10 通过 / 20 失败 / 30 跳过 / 40 阻塞"
},
"角色": "admin(管理员)/ maintainer(用例维护者)/ runner(执行者)/ viewer(只读);平台账号 admin、qa_zhang、qa_li",
"接口与错误码": "前缀 /api/v1;统一响应 {code,msg,data,trace_id};400xx 参数(40001)、401xx 鉴权(40101 未登录、40102 token 过期)、403xx 权限(40301)、500xx 服务端(50001)",
"端口与镜像": "tdplat-api 容器内 8080 / 宿主 9100;镜像 mall-qa/tdplat-api、mall-qa/tdplat-agent、mall-qa/tdplat-web",
"里程碑": "M1 骨架与登录 → M2 用例与套件管理 → M3 任务与执行引擎 → M4 报告中心与结果下钻"
}
},
"forbidden": [
@@ -71,6 +97,17 @@
{ "re": "\\bqa/testdata\\b", "hint": "Go CLI 交付物模块路径统一为 qa/tdcheck" },
{ "re": "\\btestdev/ordercli\\b", "hint": "Go 示例模块路径统一为 qa/tdcheck" },
{ "re": "\\btdframe\\b", "hint": "阶段 2 收口的统一框架仓库统一为 qa/tdrun" },
{ "re": "\\btdrunner\\b", "hint": "阶段 2 收口的统一框架仓库统一为 qa/tdrun" }
{ "re": "\\btdrunner\\b", "hint": "阶段 2 收口的统一框架仓库统一为 qa/tdrun" },
{ "re": "\\btd[-_]?platform\\b", "hint": "阶段 3 测试平台统一叫 qa/tdplat" },
{ "re": "\\btest[-_]?platform\\b", "hint": "阶段 3 测试平台统一叫 qa/tdplat" },
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(case_info|test_case|cases)\\b", "hint": "平台用例表统一为 tp_case" },
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(suite_info|test_suite|suites)\\b", "hint": "平台套件表统一为 tp_suite" },
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(task_info|test_task|jobs)\\b", "hint": "平台任务表统一为 tp_task" },
{ "re": "\\b(run_record|exec_record|execution_record)\\b", "hint": "平台执行记录统一为 tp_run" },
{ "re": "\\b(report_detail|case_result|result_detail)\\b", "hint": "平台结果明细统一为 tp_run_item" },
{ "re": "\\b(platform_user|qa_user)\\b", "hint": "平台用户表统一为 tp_user" },
{ "re": "\\b(updated_at|started_at|finished_at|added_at|archived_at)\\b\\s+(DATETIME|TIMESTAMP|DATE|INT|BIGINT)", "hint": "平台表时间字段统一为 *_time(update_time / start_time / finish_time / add_time / archive_time)" },
{ "re": "<td>(updated_at|started_at|finished_at|added_at|archived_at)</td>", "hint": "平台表时间字段统一为 *_time(update_time / start_time / finish_time / add_time / archive_time)" }
]
}