Skip to content

test(engine): 补充 HUTB 改动的自动化测试 - #49

Closed
Dame-time-0034 wants to merge 1 commit into
OpenHUTB:hutbfrom
Dame-time-0034:ci/hutb-automation-tests
Closed

Dame-time-0034 wants to merge 1 commit into
OpenHUTB:hutbfrom
Dame-time-0034:ci/hutb-automation-tests

Conversation

@Dame-time-0034

Copy link
Copy Markdown
Contributor

改动内容

补齐 engine 的测试覆盖:此前 Linux CI 只跑 Core 的基础用例(21 个),
HUTB 对引擎的定制改动没有任何自动化验证。

新增用例(Engine/Source/Runtime/Engine/Private/Tests/HutbAutomationTests.cpp)

System.Engine.Hutb.SceneComponent.SetupAttachment

  • 正常挂接只登记 AttachParent / AttachSocketName,不写入 AttachChildren;
  • 相同参数重复调用直接返回(新增的早退分支);
  • 换父组件时 socket 重置;传 nullptr 解除待挂接;
  • 自挂接、形成环被 ensure 拦截,状态不变;
  • 已通过 AttachToComponent 连接后再调用 SetupAttachment 被 ensure 拦截,状态不变。

System.Engine.Hutb.BlueprintGeneratedClass.IsAsset

  • 普通 BPGC 视为资源;
  • CLASS_NewerVersionExists、RF_Transient、RF_ClassDefaultObject 均不视为资源;
  • 清除标记后恢复。

CI 调整

Linux workflow 默认测试过滤条件追加:

+Filter:System.Engine.Hutb+System.Engine.Attachment

其中 System.Engine.Hutb 为本次新增的 HUTB 用例,System.Engine.Attachment
为引擎自带的完整挂接测试(本次改动的上游功能基线),用于覆盖 AttachTo /
Detach / 层级变换等路径。

验证

由 PR 触发的 Linux CI 完成:编译引擎 → 运行自动化测试 → 解析报告。

备注

SetupAttachment 的非法调用路径会触发 ensure,测试中用 AddExpectedError
显式声明期望的错误日志,避免自动化框架将其判定为失败。

@Dame-time-0034
Dame-time-0034 force-pushed the ci/hutb-automation-tests branch 2 times, most recently from 8e2062d to a89e0fd Compare November 24, 2026 13:06
- 新增 HutbAutomationTests.cpp:SetupAttachment 的早退/自挂接/成环/
  已 AttachTo 等分支,以及 BlueprintGeneratedClass::IsAsset 的
  CLASS_NewerVersionExists、transient、CDO 判定
- Linux CI 默认过滤条件加入 System.Engine.Hutb 与 System.Engine.Attachment
@Dame-time-0034
Dame-time-0034 force-pushed the ci/hutb-automation-tests branch from a89e0fd to 8e320ad Compare November 24, 2026 13:20
@donghaiwang

Copy link
Copy Markdown
Member

不要使用每次push来触发测试,这样关注的人都会收到不必要的邮件,先要在自己环境上测试通过,在打开PR,然后也是用手动方式(workflow_dispatch)进行触发。已分配了相应权限。

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.

2 participants