已合并
【UBSE】补充IT用例 #1511
【UBSE】补充IT用例 #1511
已合并
weaver创建于 5 天前
weaver
weaver
5 天前

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 weaver 的贡献)
weaverweaver
5 天前 创建了 pull request,commit 4b3fb9a7
weaverweaver
5 天前 关联了issue:[Enhancement]: [UBSE] 补充0/1级 IT用例
atomgit-bot
atomgit-bot
5 天前 评论:

变更摘要

该 PR 为 UBSE 项目补充集成测试(IT)用例,核心是新增一套日志相关测试模块 test/IT/tests/log/log_cases.cpplog_cases.h,覆盖日志绕接、绕接文件数量上限、日志格式/权限校验和日志回调注册;同时在选举测试 election_cases.cpp 中新增双节点周期对账、节点信息上报汇总及四节点启动平滑三个用例,并在单节点、双节点、四节点三个场景的 all_tests.cpp 中完成用例注册,共涉及 11 个文件、净增约 865 行。

主要改动

  • 新增日志测试模块:新建 test/IT/tests/log/log_cases.cpp(+589 行)与 log_cases.h,提供 RunLogRotationTestRunLogRotationFileNumTestRunLogFormatTestRunLogCallbackTest 四个用例,分别验证修改 log.max.fileSize 后日志绕接与压缩文件生成、log.fileNums=3 时绕接文件数量上限及最早日志包被删除替换、日志文件权限 640 及标准/第三方组件两种日志格式与合法等级(WARN/DEBUG/INFO/ERROR/CRIT)、以及通过 ubs_engine_log_callback_register 注册自定义处理函数 SimpleLogHandler 后按 [simple_log_handler] 格式输出。

  • 双节点选举/上报用例:在 election_cases.cpp 中新增 RunTwoNodePeriodicLedgerTest(验证 UbseNodeLedger 周期对账定时器每 5 分钟触发 cluster 状态 WORKING->SMOOTHING 与恢复 SMOOTHING->WORKING 日志)和 RunTwoNodeNodeReportSummaryTest(校验 ubse node last 1min report summary 汇总日志持续上报),并新增辅助函数 MatchTimeText 用于提取日志首/尾时间戳,同时更新 election_cases.h 声明。

  • 四节点启动平滑用例:在 election_cases.cpp 新增 RunFourNodeStartupSmoothTest,验证新集群收敛为 1 主 + 1 备 + 2 agent 后,逐节点校验其 local 状态 READY(1)local node update local state to 1)与 cluster 状态 WORKING(2)update cluster state, current state=1, update state=2)日志。

  • 场景用例注册:在 tongsuan_1d_single_node/all_tests.cpp(引入 tests/log/log_cases.h 并注册 4 个日志用例)、tongsuan_1d_two_nodes/all_tests.cpp(注册 PeriodicLedgerNodeReportSummary)及 tongsuan_1d_four_nodes/all_tests.cpp(注册 StartupSmooth)中接入上述新用例。

likedislike
atomgit-bot
atomgit-bot
5 天前 评论:

代码审查

✅ 未发现问题

likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 将hlinbo,shw030915,Gao_Victor,qmyyxtl,caowaterman设为审查人
此处折叠了80条消息 查看更多
openeuler-ci-bot
openeuler-ci-bot成员
5 天前 评论:

Review Code Feedback

  • The label approved was added to this pull request. It means that xuchenfengcleancode reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
hlinbo成员
4 天前 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
4 天前 添加了label:lgtm-hlinbo
openeuler-ci-bot
openeuler-ci-bot成员
4 天前 评论:

Review Code Feedback

  • The label lgtm-hlinbo was added to this pull request. It means that hlinbo reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
4 天前 合入了pull request,合并节点 SHA:d7fa392c21a0af7cada0533215cf9618a4c127c5