Skip to content

test(DeviceInput): 同步 getPS2Syspath 用例断言至修复后正则行为 - #902

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:ut-t02-fixup
Oct 26, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:ut-t02-fixup

Conversation

@add-uos

@add-uos add-uos commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

概述

同步 getPS2Syspath 用例断言至修复后的正则行为。仅改动 1 个测试源码文件。

背景

  • 单元测试阶段发现 DEFECT-001:DeviceInput::getPS2Syspath 非 i2c 分支贪婪正则多捕获一级 /input,已由 fix: correct PS/2 syspath regex in non-i2c branch #845 修复并合入 master(统一正则 S: Sysfs=(.*)/input/input[0-9]{1,2})
  • 原用例 UT_DeviceInputBus_GetPS2Syspath_EventMatch_ExtractsSysPath 断言的是修复前实测的缺陷行为(/serio1/input),修复合入后该断言过期失败

改动内容

  • tests/src/DeviceManager/ut_deviceinput_bus.cpp:断言值由 /devices/platform/i8042/serio1/input 更新为 /devices/platform/i8042/serio1,注释同步说明缺陷已修复,两分支行为一致

测试影响

  • 范围内 5 个套件 153/153 用例全部通过(本地实测)
  • 无生产代码改动

Summary by Sourcery

Align the DeviceInput syspath unit test with the corrected getPS2Syspath behavior.

Enhancements:

  • Update the DeviceInput syspath test to expect the corrected non-i2c path extraction behavior and document consistency between both matching branches.

Tests:

  • Synchronize the getPS2Syspath event-match assertion with the fixed regular-expression behavior.

DEF-DM-001(getPS2Syspath 非 i2c 分支贪婪正则)已由 PR linuxdeepin#845 修复并合入
master(统一正则 /input/input[0-9]{1,2}), 原用例断言的是修复前实测的
多一级 /input 捕获行为, 现更新为修复后的正确提取值, 与 i2c 分支一致。

Log: 断言值由 /devices/platform/i8042/serio1/input 更新为
/devices/platform/i8042/serio1, 注释同步说明缺陷已修复
Influence: 仅测试断言, 无生产代码改动; 全套件 153/153 通过
@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Sorry @add-uos, 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 22 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026

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

Reviewer's Guide

本 PR 仅更新一个单元测试文件,使 getPS2Syspath 的非 i2c 场景断言匹配已合入的正则修复结果;不涉及生产代码,并据描述已通过范围内 5 个套件的 153 个用例。

File-Level Changes

Change Details Files
同步 getPS2Syspath 单元测试断言与修复后的统一正则行为。
  • 将非 i2c 事件路径期望值从包含末级 /input 更新为捕获至 serio1 的路径
  • 更新测试注释,说明非 i2c 分支贪婪正则缺陷已修复且两分支行为一致
tests/src/DeviceManager/ut_deviceinput_bus.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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交为测试用例断言同步更新,将 getPS2Syspath 用例的期望值从修复前 非i2c分支贪婪正则的错误匹配结果(/devices/platform/i8042/serio1/input) 更新为正则修复后的正确结果(/devices/platform/i8042/serio1),变更范围 小且目的明确。四维度分析均未发现问题,启发式扫描与 OCR 审查亦无问题。

🔍 详细分析

1. 语法逻辑 ✅

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

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

建议: []


2. 代码质量 ✅

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

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

建议: []


3. 代码性能 ✅

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

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

建议: []


4. 代码安全 🔒

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

🔐 发现 0 个安全漏洞

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

建议: []


💡 改进建议代码示例

本次变更无需修复,代码正确。测试断言已与修复后的正则行为保持一致。

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

@deepin-ci-robot

Copy link
Copy Markdown

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

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

@add-uos

add-uos commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 79c8790 into linuxdeepin:master Oct 26, 2026
17 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