WMS_MAIN/METHOD_OUTPUT_REGRESSION_20260322.md
2026-03-23 17:10:07 +08:00

95 lines
2.3 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.

# Method 输出一致性回放说明
更新时间: 2026-03-22
## 1. 新交付条件
- 所有模型/关联相关改动,必须先执行 method 输出基线回放。
- 改动完成后,必须对同一批 method 执行 compare 回放。
- 交付标准: 修改前后 method 输出一致。
- 允许屏蔽波动字段: token、timestamp、last_login_at、created_at、updated_at、iat、exp。
## 2. 测试账号
- username: liufumingren
- password: 111111
## 3. 方法使用来源
- method 定义来源: methods/system.json
- 回放脚本会从该配置中读取 method 分组、描述、参数定义,作为样本元数据。
## 4. 测试数据来源
- 主来源表: wms_system_log
- 参考日志表:
- wms_api_log
- wms_operation_log
- wms_account_login_log
- 样本选择原则:
- 优先同账号(liufumingren)
- 优先只读方法(get/list/query/detail/info/stats)
- 优先较新数据(按日志 id 倒序)
- 优先方法去重
## 5. 执行脚本
脚本文件:
- script/method-output-regression.cjs
命令:
```powershell
# 修改前执行,生成基线
node .\script\method-output-regression.cjs baseline 8
# 修改后执行,对比输出
node .\script\method-output-regression.cjs compare
```
输出文件:
- temp/method-output/method-output-baseline.json
- temp/method-output/method-output-baseline.md
- temp/method-output/method-output-compare.json
## 6. 本次基线执行结果(修改前)
执行时间:
- baseline: 2026-03-22T13:56:52Z
- compare: 2026-03-22T13:56:57Z
样本数:
- 8
样本 method(来自 temp/method-output/method-output-baseline.md):
- storage.receiving.getReceivingDetail (sourceId: 10790)
- order.getOrderModels (sourceId: 10783)
- print.getList (sourceId: 10611)
- print.getComputerPrinter (sourceId: 10579)
- print.getItem (sourceId: 10578)
- print.getComputer (sourceId: 10577)
- store.getStoreRoles (sourceId: 10553)
- index.getExpressList (sourceId: 9820)
比对结果:
- total: 8
- mismatch: 0
- pass: true
说明:
- 当前样本中既包含 200 成功响应,也包含 403 权限响应。
- 403 响应同样纳入一致性校验范围(用于防止权限链路被意外改变)。
## 7. 后续执行要求
- 每次开始改动前,先运行 baseline 并保留输出文件。
- 每次改动后,必须运行 compare。
- 若 mismatch > 0,禁止进入交付,需先排查差异并补充说明。