WMS_MAIN/test_reports/fail/20260414-库存效期任务实例形态回归测试报告.md
2026-04-16 20:00:01 +08:00

39 lines
1.8 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.

# 库存效期任务实例形态回归测试报告
- 测试类型:单元测试
- 测试目标:为 [app/schedule/notice_stock_remaining.js](../../app/schedule/notice_stock_remaining.js) 补充回归测试,验证 Storage.findAll 返回 Sequelize 实例风格对象时,任务仍能识别 stock_id / id / expiry_date / space 并发送通知、回写缓存。
## 测试范围
- [test/app/schedule/notice_stock_remaining.test.js](../../test/app/schedule/notice_stock_remaining.test.js)
- [app/schedule/notice_stock_remaining.js](../../app/schedule/notice_stock_remaining.js)
## 测试产物
- 新增测试用例:普通对象路径 + Sequelize 实例形态路径
- 测试命令:`npm run test:local -- test/app/schedule/notice_stock_remaining.test.js`
## 测试结果摘要
- 普通对象用例:通过
- 实例形态用例:失败
- 失败数:1
- 通过数:1
## 失败用例
- 用例名:`should read Sequelize instance-style rows via getDataValue/get and still send notice`
- 失败位置:[test/app/schedule/notice_stock_remaining.test.js](../../test/app/schedule/notice_stock_remaining.test.js#L254)
- 断言:`assert.equal(noticePayloads.length, 1)`
- 实际值:`noticePayloads.length === 0`
## 失败原因
当前任务实现仍只通过自有属性读取字段。实例形态对象虽然提供了 `getDataValue/get`,但任务代码没有调用这些方法,因此 `stock_id/id/expiry_date/space` 没有被识别,通知未发送,缓存也未回写。
## 结论与建议
- 本次测试补强已覆盖普通对象路径,并新增了实例形态回归用例。
- 由于业务代码未调整,实例形态用例仍然失败,当前问题未被修复。
- 若要让该回归测试通过,需要在任务实现中补充对 Sequelize 实例的读取兼容,但本次按要求未修改业务代码。