test(dconfig): add unit tests for dconfig-center - #158
Conversation
1. Add ut_dconfig_global.cpp for global utility function tests 2. Add ut_helper.cpp for cache manager and helper function tests 3. Expand ut_dconfigconn.cpp with 8 new test cases 4. Expand ut_dconfigserver.cpp with 9 new test cases 5. Fix reload_withFileChange test path resolution in ut_dconfigserver 6. Add MetaFileGuard RAII and improve EnvGuard cleanup in test_helper 7. Update CMakeLists.txt with ENABLE_COVERAGE option and new sources Influence: 1. Verify all 202 test cases pass with 0 failures 2. Check coverage meets line 86.3% and function 96.9% thresholds 3. Validate ENABLE_COVERAGE option defaults to OFF 4. Test reload_withFileChange with correct path resolution test(dconfig): 补充 dconfig-center 单元测试 1. 新增 ut_dconfig_global.cpp 全局工具函数测试 2. 新增 ut_helper.cpp 缓存管理器及辅助函数测试 3. 扩展 ut_dconfigconn.cpp 新增 8 个测试用例 4. 扩展 ut_dconfigserver.cpp 新增 9 个测试用例 5. 修复 ut_dconfigserver 中 reload_withFileChange 测试路径解析问题 6. 新增 MetaFileGuard RAII 并改进 EnvGuard 清理逻辑 7. 更新 CMakeLists.txt 增加 ENABLE_COVERAGE 选项及新测试源文件 Influence: 1. 验证全部 202 个测试用例通过且无失败 2. 检查覆盖率达标(行 86.3%,函数 96.9%) 3. 验证 ENABLE_COVERAGE 选项默认关闭 4. 测试 reload_withFileChange 路径解析正确性
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @MyLeeJiEun. Thanks for your PR. 😃 |
|
Warning
详情 {
"unset": {
"dconfig-center/tests/test_helper.hpp": {
"b": [
" qunsetenv(m_name);"
]
},
"dconfig-center/tests/ut_dconfigconn.cpp": {
"b": [
" qunsetenv(\"STATE_DIRECTORY\");",
" qunsetenv(\"STATE_DIRECTORY\");",
"// Branch: isDefaultValue() returns true for unset key (default)"
]
},
"dconfig-center/tests/ut_helper.cpp": {
"b": [
" qunsetenv(\"DSG_CONFIG_CONNECTION_DISABLE_DBUS\");"
]
}
}
} |
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's GuideThis PR substantially broadens dconfig-center unit coverage by adding utility/helper suites and extensive connection, resource, and server branch tests, while improving fixture isolation and introducing opt-in lcov report generation; the reported result is 202 passing, 0 failing, and 6 skipped tests with 86.3% line and 96.9% function coverage. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
补充 dde-app-services dconfig-center 单元测试代码,提升测试覆盖率。
Multica Issue: DDE-207
Changes
ut_dconfig_global.cpp— 全局工具函数测试(formatDBusObjectPath / getUserNameByUid 等)ut_helper.cpp— 缓存管理器及辅助函数测试(ConfigSyncRequestCache / RefManager 等)ut_dconfigconn.cpp— 新增 8 个测试用例,修复 save 断言路径匹配问题ut_dconfigserver.cpp— 新增 9 个测试用例,修复 reload_withFileChange 路径解析test_helper.hpp— 新增 MetaFileGuard RAII,EnvGuard 改用 rmpath 递归清理CMakeLists.txt— ENABLE_COVERAGE 选项条件控制覆盖率,新增测试源文件Test Results
License
文件头版权声明年份已更新为 2026。
Summary by Sourcery
Expand dconfig-center unit-test coverage and improve test infrastructure for reliable isolation and coverage reporting.
Enhancements:
Build:
Tests:
Chores: