Skip to content

test(eventbus-redis): Redis 不支持 Streams 时跳过;chore: 升级依赖 - #119

Merged
zhaifanhua merged 2 commits into
XiHanFun:mainfrom
TW199501:chore/deps-redis-streams-skip
Sep 19, 2026
Merged

zhaifanhua merged 2 commits into
XiHanFun:mainfrom
TW199501:chore/deps-redis-streams-skip

Conversation

@TW199501

Copy link
Copy Markdown
Contributor

改动范围

两个互相独立的提交,只涉及 测试守卫依赖版本,不改任何框架运行时代码。共 11 个文件。

1. test(eventbus-redis):Redis 不支持 Streams 时跳过而非失败

问题RedisPendingBehaviorTests 的跳过守卫只判断「连得上」。开发机 6379 上若是 Redis 5.0 以下的实例(例如 Windows 移植版 3.0.x),连接成功但 XGROUPERR unknown command,5 个用例全红——实际是环境不满足前提,而不是被测行为有问题。

改动:连接后再检查 server.Features.Streams,不支持则关闭连接、整类跳过,跳过原因带服务端版本号:

Redis 不支持 Streams(3.0.504,需 5.0+),跳过该组验证。

影响:仅 framework/test/XiHan.Framework.EventBus.Redis.Tests/RedisPendingBehaviorTests.cs。CI 不起 Redis,仍走原来「不可达」的跳过分支,行为不变;Redis 5.0+ 环境下照常执行。

2. chore:升级依赖

所在项目
Microsoft.Agents.AI 1.21.0 1.22.0 AI
Microsoft.Agents.AI.Abstractions 1.21.0 1.22.0 AI.Abstractions
MailKit 4.17.0 4.18.0 Bot.Email
SqlSugarCore 5.1.4.220 5.1.4.221 Data
OpenTelemetry.*(5 个) 1.18.0 1.19.0 Observability
Scalar.AspNetCore 2.17.3 2.17.6 Web.Docs
Microsoft.NET.Test.Sdk 18.10.0 18.10.1 props/test.props
xunit.v3 4.0.0 4.0.1 props/test.props

测试包只在 props/test.props 统一升级,没有在各测试项目里逐个覆写。

Web.Core.Tests / Web.Gateway.Tests / Web.Grpc.Tests 三个项目原本就有 <PackageReference Update="Microsoft.NET.Test.Sdk" Version="18.10.0" /> 覆写,若不同步会把 test.props 的新版本压回旧值,因此只把这三处的版本号改为 18.10.1,结构不动。

验证

基于 main62e6cd05 build: v4.3.0),SDK 10.0.112:

  • dotnet build framework/XiHan.Framework.slnx -c Release -p:GeneratePackageOnBuild=false:0 警告,0 错误
  • dotnet test --solution framework/XiHan.Framework.slnx -c Release:总计 11366,失败 0,跳过 38

原跳过守卫只判断「连得上」。本机 6379 若跑着 Redis 5.0 以下的实例
(如 Windows 移植版 3.0.x),连接成功但 XGROUP 报 unknown command,
5 个用例全红,而实际上是环境不满足前提。

连接后改为再检查 server.Features.Streams,不支持则关闭连接并整类跳过,
跳过原因带上服务端版本号。CI 不起 Redis,仍走「不可达」分支,行为不变。
- Microsoft.Agents.AI / Microsoft.Agents.AI.Abstractions 1.21.0 → 1.22.0
- MailKit 4.17.0 → 4.18.0
- SqlSugarCore 5.1.4.220 → 5.1.4.221
- OpenTelemetry.* 1.18.0 → 1.19.0
- Scalar.AspNetCore 2.17.3 → 2.17.6
- Microsoft.NET.Test.Sdk 18.10.0 → 18.10.1、xunit.v3 4.0.0 → 4.0.1

测试包统一在 props/test.props 升级;Web.Core / Web.Gateway / Web.Grpc
三个测试项目原有的 Microsoft.NET.Test.Sdk 覆写同步到 18.10.1,
否则会把 test.props 的版本压回旧值。
@zhaifanhua
zhaifanhua merged commit 3e0167a into XiHanFun:main Sep 19, 2026
1 check failed
@TW199501
TW199501 deleted the chore/deps-redis-streams-skip branch September 19, 2026 22:25
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