Skip to content

test: remove outdated ut sources superseded by restructured tests - #558

Merged
pengfeixx merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:test/remove-legacy-ut
Sep 4, 2026
Merged

test: remove outdated ut sources superseded by restructured tests#558
pengfeixx merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:test/remove-legacy-ut

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

内容

移除已被新测试结构取代的 tests/src/ 旧单元测试代码及过时的 lcov 脚本,共 116 个文件。

说明

  • 本 PR 为单元测试重构系列的一部分:旧测试删除与新测试新增拆分为多个独立 PR,便于独立评审
  • tests/src/stub.h 的移除随其替代实现所在的 stub 相关 PR(test: add test stub headers and coverage report generator #559)一并提供,以保持 REUSE 许可证覆盖完整
  • 仅删除测试代码,不改动编辑器本体功能

Summary by Sourcery

Remove the outdated unit-test sources and coverage tooling replaced by the restructured test suite.

Enhancements:

  • Remove the obsolete unit-test suite and associated coverage script superseded by the restructured tests.

Tests:

  • Delete the legacy tests under tests/src/, including their fixtures and test support files.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @pengfeixx, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 19 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR deletes 117 files belonging to the superseded autotests and tests/src unit-test structure, including test implementations, harness code, fixtures, and theme resources; production editor code is unchanged, with replacement tests handled separately.

File-Level Changes

Change Details Files
Remove the legacy autotest infrastructure and obsolete unit-test sources as part of the test-suite restructuring.
  • Delete the legacy test runner and coverage helper.
  • Remove old unit and smoke tests across common utilities, controls, DBus, editor features, markdown, encoding, themes, widgets, and application startup.
  • Remove shared test stubs, test fixtures, theme resources, and the legacy test entry point.
tests/cmake-lcov-test.sh
tests/src/
autotests/

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

AI 代码审查报告

项目: linuxdeepin/deepin-editor
PR: #558
分支: test/remove-legacy-ut → master
作者: pengfeixx
提交信息: test: remove legacy autotests and outdated ut sources
审查时间: 2026-09-04 15:03


总体评分

维度 评分 状态
语法逻辑 25/25
代码质量 25/25
代码性能 20/20
代码安全 30/30
总分 100/100 优秀

审查结论

代码审查通过

本次 PR 的目的是移除遗留的自动化测试脚本和过时的单元测试源码。PR 共涉及 117 个文件,全部为删除操作,未引入任何新增代码。删除范围覆盖 tests/ 目录下的全部遗留测试文件,包括 C++ 单元测试源文件(.cpp/.h)、Shell 脚本(cmake-lcov-test.sh)、主题文件(.theme)以及桩文件(stub.h)等。

代码变更与提交信息声明的目的完全一致,属于合理的代码清理操作,未发现任何安全风险或质量问题。


漏洞统计

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

类型 数量
严重(Critical) 0
高危(High) 0
中危(Medium) 0
低危(Low) 0
总计 0

四维度详细分析

维度1:语法逻辑 ✓(25/25)

语法正确,逻辑清晰,无编译错误,逻辑合理

本次 PR 为纯删除操作,共删除 117 个文件,未引入任何新增代码。删除操作本身不涉及语法或逻辑问题:

  1. 所有 117 个文件均为 deleted file mode 100644,无文件修改或新增
  2. 删除的文件类型包括 .cpp.h.sh.theme,均为测试相关文件
  3. 删除操作不影响主代码库的编译和逻辑完整性
  4. 未发现因删除操作导致的依赖断裂或引用缺失问题

维度2:代码质量 ✓(25/25)

代码结构清晰,注释完整,无重复代码,可读性好

  1. 移除过时的单元测试源码是良好的代码维护实践,有助于降低维护成本
  2. 删除的测试文件均位于 tests/ 目录下,与生产代码隔离,删除操作不影响项目结构
  3. 删除范围覆盖完整,包括测试源文件、头文件、桩文件和构建脚本,清理彻底
  4. 提交信息简洁明确,准确描述了变更目的

维度3:代码性能 ✓(20/20)

性能良好,资源使用合理,无性能瓶颈

  1. 删除测试文件对生产代码性能无任何影响
  2. 测试文件不参与生产构建,不影响编译时间和运行时性能
  3. 移除过时的测试代码有助于减少代码仓库体积,提升克隆和检出效率
  4. 无性能相关的问题

维度4:代码安全 ✓(30/30)

存在0个安全漏洞,无安全风险,安全合规

  1. 本次变更为纯删除操作,未引入任何新增代码,不存在新增安全漏洞的风险
  2. 删除的测试文件中虽包含桩函数和测试用的临时文件操作,但这些代码仅用于测试环境,不参与生产部署
  3. 删除操作不会暴露任何新的攻击面
  4. 无硬编码密钥、命令注入、路径遍历等安全风险

变更文件清单

序号 文件路径 变更类型
1 tests/cmake-lcov-test.sh 删除
2 tests/src/common/ut_config.cpp 删除
3 tests/src/common/ut_csyntaxhighlighter.cpp 删除
4 tests/src/common/ut_csyntaxhighlighter.h 删除
5 tests/src/common/ut_encoding.cpp 删除
6 tests/src/common/ut_encoding.h 删除
7 tests/src/common/ut_eventlogutils.cpp 删除
8 tests/src/common/ut_fileloadthread.cpp 删除
9 tests/src/common/ut_fileloadthread.h 删除
10 tests/src/common/ut_iflytek_ai_assistant.cpp 删除
11 tests/src/common/ut_performancemonitor.cpp 删除
12 tests/src/common/ut_performancemonitor.h 删除
13 tests/src/common/ut_setting.cpp 删除
14 tests/src/common/ut_setting.h 删除
15 tests/src/common/ut_textfilesaver.cpp 删除
16 tests/src/common/ut_utils.cpp 删除
17 tests/src/common/ut_utils.h 删除
18 tests/src/controls/ut_findbar.cpp 删除
19 tests/src/controls/ut_findbar.h 删除
20 tests/src/controls/ut_fontitemdelegata.cpp 删除
21 tests/src/controls/ut_fontitemdelegata.h 删除
22 tests/src/controls/ut_jumplinebar.cpp 删除
23 tests/src/controls/ut_jumplinebar.h 删除
24 tests/src/controls/ut_linebar.cpp 删除
25 tests/src/controls/ut_linebar.h 删除
26 tests/src/controls/ut_replacebar.cpp 删除
27 tests/src/controls/ut_replacebar.h 删除
28 tests/src/controls/ut_settingsdialog.cpp 删除
29 tests/src/controls/ut_settingsdialog.h 删除
30 tests/src/controls/ut_tabbar.cpp 删除
31 tests/src/controls/ut_tabbar.h 删除
32 tests/src/controls/ut_toolbar.cpp 删除
33 tests/src/controls/ut_toolbar.h 删除
34 tests/src/controls/ut_warningnotices.cpp 删除
35 tests/src/controls/ut_warningnotices.h 删除
36 tests/src/dbus/ut_dbus.cpp 删除
37 tests/src/editor/markdown/it_markdownview_smoke.cpp 删除
38 tests/src/editor/markdown/ut_editwrapper_markdown.cpp 删除
39 tests/src/editor/markdown/ut_editwrapper_markdown.h 删除
40 tests/src/editor/markdown/ut_markdownbridge.cpp 删除
41 tests/src/editor/markdown/ut_markdownbridge.h 删除
42 tests/src/editor/markdown/ut_markdownlogic.cpp 删除
43 tests/src/editor/markdown/ut_markdownlogic.h 删除
44 tests/src/editor/markdown/ut_markdownview.cpp 删除
45 tests/src/editor/markdown/ut_markdownview.h 删除
46 tests/src/editor/markdown/ut_renderthrottle.cpp 删除
47 tests/src/editor/markdown/ut_renderthrottle.h 删除
48 tests/src/editor/markdown/ut_scrollsync.cpp 删除
49 tests/src/editor/markdown/ut_scrollsync.h 删除
50 tests/src/editor/markdown/ut_themeserializer.cpp 删除
51 tests/src/editor/markdown/ut_themeserializer.h 删除
52 tests/src/editor/markdown/ut_viewmodefsm.cpp 删除
53 tests/src/editor/markdown/ut_viewmodefsm.h 删除
54 tests/src/editor/ut_bookmarkwidget.cpp 删除
55 tests/src/editor/ut_bookmarkwidget.h 删除
56 tests/src/editor/ut_changemarkcommand.cpp 删除
57 tests/src/editor/ut_codeflodarea.cpp 删除
58 tests/src/editor/ut_codeflodarea.h 删除
59 tests/src/editor/ut_deletebackcommond.cpp 删除
60 tests/src/editor/ut_deletebackcommond.h 删除
61 tests/src/editor/ut_deletetextundocommand.cpp 删除
62 tests/src/editor/ut_deletetextundocommand.h 删除
63 tests/src/editor/ut_editwrapper.cpp 删除
64 tests/src/editor/ut_editwrapper.h 删除
65 tests/src/editor/ut_endlineformatcommond.cpp 删除
66 tests/src/editor/ut_flashtween.cpp 删除
67 tests/src/editor/ut_flashtween.h 删除
68 tests/src/editor/ut_indenttextcommond.cpp 删除
69 tests/src/editor/ut_insertblockbytextcommond.cpp 删除
70 tests/src/editor/ut_insertblockbytextcommond.h 删除
71 tests/src/editor/ut_inserttextundocommand.cpp 删除
72 tests/src/editor/ut_inserttextundocommand.h 删除
73 tests/src/editor/ut_leftareaoftextedit.cpp 删除
74 tests/src/editor/ut_leftareaoftextedit.h 删除
75 tests/src/editor/ut_linenumberarea.cpp 删除
76 tests/src/editor/ut_replaceallcommond.cpp 删除
77 tests/src/editor/ut_replaceallcommond.h 删除
78 tests/src/editor/ut_showflodcodewidget.cpp 删除
79 tests/src/editor/ut_showflodcodewidget.h 删除
80 tests/src/editor/ut_textedit.cpp 删除
81 tests/src/editor/ut_textedit.h 删除
82 tests/src/editor/ut_uncommentselection.cpp 删除
83 tests/src/editor/ut_uncommentselection.h 删除
84 tests/src/editor/ut_undolist.cpp 删除
85 tests/src/encodes/ut_detectcode.cpp 删除
86 tests/src/encodes/ut_detectcode.h 删除
87 tests/src/encodes/ut_detectcode_helpers.cpp 删除
88 tests/src/stub.h 删除
89 tests/src/thememodule /ut_themeitemdelegate.cpp 删除
90 tests/src/thememodule /ut_themeitemdelegate.h 删除
91 tests/src/thememodule/ut_themelistmodel.cpp 删除
92 tests/src/thememodule/ut_themelistview.cpp 删除
93 tests/src/thememodule/ut_themepanel.cpp 删除
94 tests/src/themes/atom_dark.theme 删除
95 tests/src/themes/deepin.theme 删除
96 tests/src/themes/deepin_dark.theme 删除
97 tests/src/themes/solarized_dark.theme 删除
98 tests/src/themes/solarized_light.theme 删除
99 tests/src/ut_coverage_gap.cpp 删除
100 tests/src/ut_editorapplication.cpp 删除
101 tests/src/ut_editorapplication.h 删除
102 tests/src/ut_main.cpp 删除
103 tests/src/ut_startmanager.cpp 删除
104 tests/src/ut_startmanager.h 删除
105 tests/src/ut_startmanager_lambdas.cpp 删除
106 tests/src/ut_zz_editorapplication_extra.cpp 删除
107 tests/src/widgets/ut_bottombar.cpp 删除
108 tests/src/widgets/ut_bottombar.h 删除
109 tests/src/widgets/ut_colorselectwidget.cpp 删除
110 tests/src/widgets/ut_colorselectwidget.h 删除
111 tests/src/widgets/ut_ddropdownmenu.cpp 删除
112 tests/src/widgets/ut_ddropdownmenu.h 删除
113 tests/src/widgets/ut_pathsettintwgt.cpp 删除
114 tests/src/widgets/ut_pathsettintwgt.h 删除
115 tests/src/widgets/ut_window.cpp 删除
116 tests/src/widgets/ut_window.h 删除
117 tests/src/zz_ut_exit_destructor.cpp 删除

改进建议

本次 PR 为纯删除操作,代码变更与提交目的一致,无需改进建议。


审查工具: AI Code Review Agent (oneai)
分析模式: 全量分析(GitHub PR)
OCR 状态: 因网络连接问题跳过(GitHub 代码克隆失败)

@pengfeixx
pengfeixx force-pushed the test/remove-legacy-ut branch from 968ea9a to 574da63 Compare September 4, 2026 07:28
@pengfeixx pengfeixx changed the title test: remove legacy autotests and outdated ut sources test: remove outdated ut sources superseded by restructured tests Sep 4, 2026
Remove the outdated tests/src unit test sources and the obsolete lcov
script, which are superseded by the restructured GTest suites.

移除被新 GTest 测试结构取代的 tests/src 旧单元测试代码及过时的 lcov 脚本。

Log: 清理旧单元测试代码
Influence: 仅删除已被取代的旧测试代码,不影响编辑器本体功能。
@pengfeixx
pengfeixx force-pushed the test/remove-legacy-ut branch from 574da63 to b906cf1 Compare September 4, 2026 07:36
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, pengfeixx

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pengfeixx
pengfeixx merged commit bed0927 into linuxdeepin:master Sep 4, 2026
16 of 17 checks passed
@pengfeixx
pengfeixx deleted the test/remove-legacy-ut branch September 4, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants