Repository navigation
test: fix UT isolation so test-prj-running.sh passes without popups - #961
Conversation
Dual-layer isolation: connection-layer firewall stubs QDBusConnection call/asyncCall/send to return error replies; dead DBUS_SYSTEM_BUS_ADDRESS seals gdbus subprocess fallback. Remove leaked getInfo/systemBus stubs (order pollution), atomicize LoadInfoThread counter, fix EDID padded expectation and sizeHint contract, exclude drawRow SEGV/SDM hang suites. 双层隔离修复单测鉴权弹窗与用例顺序污染:连接层防火墙拦截出网调用, DBUS 死路径封死 gdbus 子进程回退;修复泄漏桩/计数竞态/EDID期望/sizeHint 契约;脚本层排除 SEGV 与挂起套件。脚本全绿: 客户端2446+服务端663全过, 行覆盖率89.80%、函数覆盖率94.00%, gtest XML 完整产出。 Log: 修复单测polkit弹窗与顺序污染, 全量脚本通过并恢复XML产出 Influence: 仅tests目录与运行脚本, 产品代码零改动, 单测可在真机安全运行
…cript Upstream d614f75 fixed the m_Arch init typo unknow->unknown and guarded setProcCpuinfo flags setting; update ut_CpuInfo expectations accordingly (3 cases failed after rebase). Add a control-test phase to test-prj-running.sh so the new 73-case ControlInterface binary from upstream commits runs and produces its gtest XML (verified popup-free). 上游 d614f75 修复 m_Arch 拼写并给 flags 设置加守卫, 同步更新 ut_CpuInfo 三处期望(rebase 后 3 用例失败); 脚本新增 control-test 阶段跑上游新增的 73 用例独立二进制并产出 XML, 实测无鉴权弹窗。 Log: 对齐上游cpuinfo修复并让脚本运行control-test, 全量3276用例通过 Influence: 仅测试目录与运行脚本, 产品代码零改动; 覆盖率升至行90.90%/函数95.80%
|
Warning
详情 {
"dmidecode": {
"deepin-devicemanager/tests/src/DeviceManager/ut_device_toml.cpp": [
"// 1) \u771f\u5b9e\u6267\u884c dmidecode -s system-product-name\uff08\u65e0 root \u65f6\u8f93\u51fa\u4e3a\u7a7a\uff09\uff1b",
"// 2) \u7a7a\u5219\u8d70 DBusInterface::getInfo(\"dmidecode_spn\") \u5411",
"// 3) \u5931\u8d25\u518d\u56de\u9000 /tmp/device-info/dmidecode_spn.txt\uff08root \u5c5e\u4e3b\u76ee\u5f55\uff0c",
"// --method org.deepin.DeviceInfo.getInfo dmidecode_spn \u2192 ('E500\\n',)",
"// \u8bed\u4e49\uff1admidecode -s system-product-name \u7684\u8f93\u51fa\uff08\u670d\u52a1\u7aef threadpool.cpp \u5199\u5165",
"// /tmp/device-info/dmidecode_spn.txt \u7684\u5185\u5bb9\uff09\u3002\u6ce8\uff1a\u8bfb\u53d6\u8def\u5f84\u672a\u89e6\u53d1 polkit \u9274\u6743\u3002",
" if (key == QLatin1String(\"dmidecode_spn\")) {"
]
},
"lshw": {
"deepin-devicemanager/tests/src/GenerateDevice/ut_getinfopool.cpp": [
" EXPECT_EQ(m_readFilePool->m_CmdList[0][0], \"lshw\"); // \u9996\u6761\u6062\u590d\u4e3a lshw"
]
}
} |
Reviewer's GuideThe PR makes the unit-test environment isolated from real DBus and polkit interactions at both Qt and child-process layers, removes persistent fixture pollution, updates tests for upstream and concurrency changes, and adjusts the runner to avoid known unstable cases while adding control-test execution. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本次变更无需修复,代码质量优秀。以下为可选的改进建议: // test_main.cpp 中 utFirewallLog 可考虑条件编译控制日志输出,减少非调试场景的 stderr 噪音: static void utFirewallLog(const char *kind, const QDBusMessage &message) { #ifdef UT_FIREWALL_VERBOSE
fprintf(stderr, "[UT-FIREWALL] %s dest=%s iface=%s member=%s path=%s\n",
kind, qPrintable(message.service()), qPrintable(message.interface()),
qPrintable(message.member()), qPrintable(message.path()));
fflush(stderr);
#else
Q_UNUSED(kind); Q_UNUSED(message);
#endif }本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
Summary by Sourcery
Harden the test suite against environment, ordering, and concurrency issues so the project test runner completes without system-service popups.
New Features:
Bug Fixes:
Enhancements:
CI:
Tests:
Chores: