73 lines
3.1 KiB
Markdown
73 lines
3.1 KiB
Markdown
# 收货入库回归测试报告
|
||
|
||
- 测试类型:回归测试 / 单元测试
|
||
- 执行时间:2026-04-17 17:27:16
|
||
- 执行入口:`npm run test:local`
|
||
- 覆盖目标:
|
||
- [test/app/controller/system.storage.receiving.test.js](../test/app/controller/system.storage.receiving.test.js)
|
||
- [test/app/service/systems/storage.receiving.detailChange.test.js](../test/app/service/systems/storage.receiving.detailChange.test.js)
|
||
- [test/app/service/systems/storage.receiving.report.test.js](../test/app/service/systems/storage.receiving.report.test.js)
|
||
|
||
## 测试目标
|
||
|
||
验证收货模块现有回归用例是否稳定,重点覆盖收货列表、收货明细变更、收货完成报表三条链路。
|
||
|
||
## 测试范围
|
||
|
||
本次仅执行现有回归用例,不修改任何代码,不新增任何测试数据。
|
||
|
||
## 测试产物
|
||
|
||
- Mocha / egg-bin 执行结果
|
||
- mochawesome 报告:`node_modules/.mochawesome-reports/mochawesome.html`
|
||
- 本测试报告:`test_reports/fail/20260417-172716-收货入库回归测试报告.md`
|
||
|
||
## 测试结果摘要
|
||
|
||
- 通过:2 个目标文件
|
||
- 失败:1 个目标文件
|
||
- 总计:3 个目标文件
|
||
- 通过用例数:28
|
||
- 失败用例数:1
|
||
|
||
### 通过项
|
||
|
||
- [test/app/controller/system.storage.receiving.test.js](../test/app/controller/system.storage.receiving.test.js):15 passing
|
||
- [test/app/service/systems/storage.receiving.report.test.js](../test/app/service/systems/storage.receiving.report.test.js):13 passing
|
||
|
||
### 失败项
|
||
|
||
- [test/app/service/systems/storage.receiving.detailChange.test.js](../test/app/service/systems/storage.receiving.detailChange.test.js)
|
||
- 失败用例:`should reject expired expiry_date before updating receiving detail`
|
||
- 失败断言:期望返回 `code = 400`,实际返回 `code = 500`
|
||
- 失败位置:测试文件第 112 行附近
|
||
|
||
## 失败原因
|
||
|
||
当前 `detailChange` 实现没有在明细更新前拦截过期 `expiry_date`,请求继续进入后续更新流程;随后执行到 `updateReceivingStats`,而该单测 harness 未提供 `ctx.model.transaction`,最终被服务层 `catch` 转成 `500`。
|
||
|
||
相关实现位置:
|
||
|
||
- [app/service/systems/storage/receiving.js](../app/service/systems/storage/receiving.js#L1952)
|
||
- [app/service/systems/storage/receiving.js](../app/service/systems/storage/receiving.js#L1686)
|
||
|
||
## 最小复现信息
|
||
|
||
```text
|
||
npm run test:local -- test/app/service/systems/storage.receiving.detailChange.test.js
|
||
```
|
||
|
||
该单测即可稳定复现失败,无需额外环境操作。
|
||
|
||
## 环境 / 数据 / 依赖影响判断
|
||
|
||
- 环境:未见 npm / egg-bin 启动失败,测试框架可正常运行
|
||
- 数据:未观察到外部测试数据缺失导致的报错,本次失败是可复现的断言失败
|
||
- 依赖:未发现缺包或安装失败问题
|
||
- 结论:本次失败主要来自当前实现与现有回归用例预期不一致,且单测 harness 对下游事务依赖的模拟不完整
|
||
|
||
## 结论与建议
|
||
|
||
- 当前收货回归测试整体为部分通过,2 个目标文件通过,1 个目标文件失败
|
||
- 失败场景是收货明细变更的过期日期拦截,建议后续补齐该分支的业务校验后再回归验证
|