✅ test(coverage): 补充组件生产分支覆盖 - #382
Merged
JunLang-7 merged 5 commits intoAug 27, 2026
Merged
Conversation
补充 IM snooze 缺少 minutes、MCP 未知类型回退、SQLite 查询 SQL 构造以及 Runtime 主机不可用入口的可观察测试。\n\n新增测试覆盖 contracts/im、mcp、storage_sqlite 与 runtime 的低覆盖分支,不改变生产行为。相关定向主机测试 5/5 通过。\n\nRefs 1024XEngineer#378
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #382 +/- ##
==========================================
+ Coverage 90.27% 90.42% +0.14%
==========================================
Files 213 213
Lines 25697 25707 +10
Branches 6728 6734 +6
==========================================
+ Hits 23199 23246 +47
+ Misses 1151 1128 -23
+ Partials 1347 1333 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
审阅了本 PR 新增的五个主机覆盖测试单元:SQLite 查询 SQL、IM snooze 参数校验、MCP JSON writer 回退、MCP server Schema 回退,以及主机环境 USB 串口路由不可用分支。新增断言与对应生产代码契约一致,未发现由本 PR 引入的可操作正确性、可靠性或兼容性问题。
验证:五个受影响测试目标均成功构建并通过(sqlite_database_test、im_contract_parser_test、mcp_json_writer_coverage_test、mcp_server_coverage_test、usb_serial_frame_router_test)。完整主机构建仍受仓库其他显示/音频 ESP 头文件中的既有 [[maybe_unused]] 与 -Werror 警告阻塞。
jing-gou
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
补充 Issue #378 中低覆盖率生产源码的主机测试:
voicelife_contracts/src/im:覆盖字段类型、枚举、可选字段、状态一致性、时间窗口与结果计数等分支。voicelife_mcp/src/mcp_json_writer.cc:覆盖结构化输出类型、嵌套对象、Schema 约束和分页游标。voicelife_mcp/src/tools/schedule_mcp_tools.cc、schedule_rule_mcp_tools.cc:保留并运行现有成功、失败、恢复和规则边界测试。voicelife_mcp/src:覆盖未知输入/输出类型的安全回退。voicelife_storage_sqlite/src:显式验证操作记录与日程查询/计数 SQL 构造。voicelife_runtime/src/usb_serial_frame_router.cc、linx_mcp_bridge.cc:覆盖主机不可用路径和 JSON-RPC 参数边界。TDD / 验证
git diff --check:通过。python3 scripts/check_commit_message.py --range upstream/main..HEAD:通过。风险
仅新增测试,不改变生产逻辑、协议或持久化格式。完整覆盖率与 Codecov 结果以 PR CI 为准。
Closes #378