WMS_MAIN/test_reports/pass/20260418-1954-business_key数组语义回归测试报告.md
2026-04-27 16:09:26 +08:00

41 lines
1.9 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.

# business_key数组语义回归测试报告
- 测试类型:单元测试 + 回归测试
- 测试目标:验证 business_key 数组语义已在代码层生效,并确认不破坏现有 batching、grouping 与 async post-process 行为。
- 测试范围:
- `test/app/service/systems/express.test.js`
- `test/app/service/systemMethods/order/pendingOrder.allocateExpressCode.test.js`
- `test/app/service/systems/express.createWaybillCode.balance.test.js`
- `test/app/service/systems/express.async_dispatch.test.js`
## 测试产物
- 代码调整:`app/service/systems/express.js`
- 回归测试:上述 4 个测试文件
- 测试报告:本文件
## 测试结果摘要
- 总计:31
- 通过:31
- 失败:0
## 覆盖断言
1. `business_key: [1]` 可正常进入创建链路并保持单条语义。
2. `business_key: [2,3]` 会在服务层展开为多条内部记录。
3. 数值、字符串、数组混合输入可兼容处理,且重复业务键不会生成重复内部记录。
4. `order_id + business_key` 的内部记录唯一性得到验证。
5. 现有 batching 逻辑仍按每批最多 10 条执行,grouping 仍按 `sys_platform_code + logistics_code` 分组。
6. async post-process 仍可正常触发,且派发到平台时看到的是展开后的 `order_list`。
7. `pendingOrder.allocateExpressCode` 仅透传入参,不会在入口层改写 `business_key` 数据结构。
## 结论
本次回归验证通过,`business_key` 数组语义已在服务层生效,且未观察到对 batching、grouping 或 async post-process 的回归。
## 风险与建议
- 当前验证主要基于服务层单元测试与 mock 调用链,未覆盖真实数据库唯一索引和事务回滚场景。
- `createWaybillCode` 路径对同一 `order_id` 的重复查询条件仍可能出现重复值,但不影响当前语义与结果;若后续要做性能优化,可再补一条去重查询的专项回归。