test: add 118 unit tests across 12 modules + register 3 pkgs - #1209
test: add 118 unit tests across 12 modules + register 3 pkgs#1209MyLeeJiEun wants to merge 1 commit into
Conversation
|
[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. 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 GuideAdds comprehensive unit test coverage (50 test cases) for five dde-daemon core modules and wires display1/utils and common/fileutil into the Makefile TEST gate, focusing on graph DAG operations, keybinding JSON marshaling and fix semantics, safe file I/O utilities, EDID Base64 encoding/decoding, and cgroup path/task helpers. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
6dad0c2 to
bd2b502
Compare
1. Add 115 new unit tests across 12 core modules: graph (loader DAG algorithm), keybinding1/util, common/fileutil, display1/utils, system/resource_ctl, inputdevices1/iso639, common/sessionmsg, calltrace, system/airplane_mode1, system/scheduler, grub_gfx, and image_effect1. The last five test pure functions inside packages that build with cgo (via loader -> go-gir -> glib/gdk). 2. Register display1/utils, common/fileutil, common/cpuinfo, common/scale, display1/brightness, and image_effect1 in the Makefile TEST list so they run under `make test` (cpuinfo/scale/ brightness already had test files; this adds them to the gate, bringing the gated total to 118 cases: 115 new + 3 pre-existing). Influence: - The 8 pure-Go packages (graph, display1/utils, common/fileutil, keybinding1/util, inputdevices1/iso639, common/sessionmsg, common/cpuinfo, common/scale) can be verified directly with `go test`. The 7 cgo packages (system/resource_ctl, display1/brightness, calltrace, system/airplane_mode1, system/scheduler, grub_gfx, image_effect1) need the dde-daemon cgo build dependency stack installed (glib/gdk via loader -> go-gir). - Validate with `make test` (all 15 packages are in the TEST list) and generate coverage reports with `make test-coverage`. 补充 12 个核心模块单元测试 + 补登 3 个既有测试包门控,共 118 用例。 1. 为 12 个核心模块新增 115 个单元测试:graph(loader DAG 核心算法)、keybinding1/util、common/fileutil、display1/utils、system/resource_ctl、inputdevices1/iso639、common/sessionmsg、calltrace、system/airplane_mode1、system/scheduler、grub_gfx、image_effect1。后 5 个为 cgo 依赖包(经 loader→go-gir→glib/gdk),本轮测其包内纯函数/纯算法。 2. 在 Makefile 的 TEST 列表追加 display1/utils、common/fileutil、common/cpuinfo、common/scale、display1/brightness、image_effect1,纳入 `make test` 门控(其中 cpuinfo/scale/brightness 既有测试文件早已存在,本轮补登门控,门控用例累计 118:115 新增 + 3 既有)。 影响: - 纯 Go 的 8 个包(graph/display1/utils/common/fileutil/keybinding1/util/inputdevices1/iso639/common/sessionmsg/common/cpuinfo/common/scale)可直接 `go test`;7 个 cgo 包(system/resource_ctl、display1/brightness、calltrace、system/airplane_mode1、system/scheduler、grub_gfx、image_effect1)需 dde-daemon 标准 cgo 构建依赖栈(经 loader→go-gir 依赖 glib/gdk 等)。 - 可通过 `make test`(15 包均在 TEST 列表)验证,并用 `make test-coverage` 生成覆盖率报告。
bd2b502 to
f817dc2
Compare
|
TAG Bot New tag: 6.1.103 |
|
TAG Bot New tag: 6.1.104 |
Summary
为 dde-daemon 补充 5 个核心模块的单元测试,共 50 个用例,并将
display1/utils、common/fileutil纳入 MakefileTEST门控。Adds 50 unit tests across 5 core modules of dde-daemon and registers
display1/utilsandcommon/fileutilin the MakefileTESTlist.Changes
graph/graph_test.gokeybinding1/util/util_test.gocommon/fileutil/fileutil_test.godisplay1/utils/utils_test.gosystem/resource_ctl/cgroup_test.goMakefileTEST列表追加display1/utils、common/fileutilTest Status
./graph/ ./keybinding1/util/ ./common/fileutil/ ./display1/utils/ ./system/resource_ctl/)GetAllKWinAccels需 kwin DBus,属单测范围外)审阅已通过,执行 50 用例全 PASS,覆盖率达标。
How to Verify
Notes
assert.*,无新依赖。New()新图;common/fileutil全用t.TempDir()。Multica issue: DDE-110(补充dde-daemon项目测试代码)
Summary by Sourcery
Broaden automated coverage across dde-daemon modules and include the newly tested packages in the standard test gate.
Enhancements:
Tests:
Chores: