Skip to content

test(shortcut): disable capture result test - #212

Merged
deepin-bot[bot] merged 3 commits into
linuxdeepin:masterfrom
mhduiy:test/task-397845-capture-results
Oct 30, 2026
Merged

deepin-bot[bot] merged 3 commits into
linuxdeepin:masterfrom
mhduiy:test/task-397845-capture-results

Conversation

@mhduiy

@mhduiy mhduiy commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

关联任务

https://pms.uniontech.com/task-view-397845.html

最终修改

  • 撤销此前的数据驱动拆分,恢复 captureReportsExplicitResults 原始实现。
  • 仅注释该用例的测试槽声明及实现,暂时不注册、不执行该用例。
  • 添加 TASK-397845 恢复标记,待 mips64 录制超时问题排查后重新启用。
  • 其他测试、生产代码保持不变;未增加固定等待或 QSKIP。

验证

本地 x86_64,隔离 Xvfb(禁用 GLX,避免本机驱动初始化问题):

  • 编译通过。
  • QtTest -functions 确认不再包含 captureReportsExplicitResults。
  • 剩余 TestX11GrabResilientShortcuts:11 passed,0 failed,0 skipped。
  • git diff --check 通过。

范围与限制

这是临时停用测试,不是生产缺陷修复;暂停该用例原有的四种录制结果覆盖。mips64 构建环境仍需重跑确认。

Summary by Sourcery

Tests:

  • Temporarily disable the captureReportsExplicitResults test pending investigation of the TASK-397845 mips64 recording timeout issue.

1. Use a fresh handler for each capture result case.
2. Preserve result assertions and isolate RECORD restart timing.

Log: Split capture result checks into independent cases.
Influence: Test isolation only; production unchanged.

test(shortcut): 隔离快捷键录制结果测试

1. 每种录制结果使用独立的处理器。
2. 保留结果断言,隔离录制监听重启时序。

Log: 将录制结果检查拆分为独立的数据驱动用例。
PMS: TASK-397845
Influence: 仅调整测试隔离,不改变生产行为。
@sourcery-ai

sourcery-ai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

The test-only change converts four sequential capture-result checks into isolated Qt data-driven invocations, giving each case its own X11 handler and RAII-managed display while preserving result and successful-shortcut assertions; review should focus on test coverage and the intentional removal of same-handler consecutive-recording coverage.

File-Level Changes

Change Details Files
Split the explicit capture-result coverage into isolated data-driven test cases.
  • Add rows for modifier-only, Escape, chord, and pointer captures with expected IDs and result states.
  • Fetch per-row parameters and dispatch the corresponding input event.
  • Retain assertions for capture ID, result status, and the successful chord string.
src/plugin-qt/shortcut/tests/tst_x11grabresilientshortcuts.cpp
Decouple each capture case from shared asynchronous RECORD restart state.
  • Instantiate a fresh X11KeyHandler for every data-driven test invocation.
  • Preserve asynchronous result polling without adding fixed waits or skips.
src/plugin-qt/shortcut/tests/tst_x11grabresilientshortcuts.cpp
Make X11 display lifetime exception-safe within the test.
  • Manage the display connection with unique_ptr and XCloseDisplay as the deleter.
  • Use the managed display handle for synthetic keyboard and pointer input.
src/plugin-qt/shortcut/tests/tst_x11grabresilientshortcuts.cpp

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

@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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

1. Revert the data-driven capture result rewrite.
2. Comment out the original test pending timeout investigation.

Log: Temporarily disable the capture result test.
Influence: Capture result coverage temporarily disabled.

test(shortcut): 暂时禁用录制结果测试

1. 撤销录制结果测试的数据驱动改写。
2. 注释原始用例,待超时问题排查后恢复。

Log: 暂时禁用快捷键录制结果测试。
PMS: TASK-397845
Influence: 暂时停用录制结果测试覆盖。
@mhduiy mhduiy changed the title test(shortcut): isolate capture result cases test(shortcut): disable capture result test Oct 30, 2026
yixinshark
yixinshark previously approved these changes Oct 30, 2026
1. Name the disabled capture result test precisely.
2. Replace the function block comment with #if 0.

Log: Clarify the temporary test disable marker.
Influence: Test remains disabled; production unchanged.

test(shortcut): 明确测试禁用标记

1. 注释明确标注被禁用的录制结果测试名称。
2. 使用条件编译替换函数实现的块注释。

Log: 明确临时禁用测试的说明与标记。
PMS: TASK-397845
Influence: 测试继续禁用,生产代码不变。
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy, yixinshark

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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交临时禁用 captureReportsExplicitResults 测试,使用注释和 #if 0 方式实现,语法正确、逻辑清晰、无安全风险。仅存在轻微代码质量问题(#if 0 不如 QSKIP 优雅),整体改动安全合理。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 建议使用 QSKIP("TASK-397845: Temporarily disabled", SkipSingle) 替代 #if 0, 保持测试函数可编译并在测试输出中显示为 SKIP 状态,便于后续追踪恢复。 示例: void TestX11GrabResilientShortcuts::captureReportsExplicitResults() {
QSKIP("TASK-397845: Temporarily disabled", SkipSingle);
// ... 原有测试代码 ...
}


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无


💡 改进建议代码示例

// 推荐使用 QSKIP 替代 #if 0: // 在 private slots 中保留声明: //     void captureReportsExplicitResults(); // // 在实现中添加 QSKIP: void TestX11GrabResilientShortcuts::captureReportsExplicitResults() {
    QSKIP("TASK-397845: Temporarily disabled", SkipSingle);
    Display *display = XOpenDisplay(nullptr);
    // ... 原有测试代码保持不变 ...
    XCloseDisplay(display);
}

本报告由 AI 代码审查工具自动生成

@mhduiy

mhduiy commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit c465f2b into linuxdeepin:master Oct 30, 2026
6 checks passed
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