Skip to content

单元测试覆盖梳理:补齐缺失的测试用例 #494

Description

@JusterZhu

背景

对 GeneralUpdate 全部组件的单元测试覆盖情况进行了系统梳理,发现以下缺口。

组件覆盖评估

组件 覆盖评级 说明
GeneralUpdate.Core 🟡 较好 (~85%) 少量模块缺失测试
GeneralUpdate.Differential 🟢 优秀 (~90%) 无需补齐
GeneralUpdate.Drivelution 🟡 需改进 (~70%) 平台实现类缺失较多
GeneralUpdate.Extension 🟢 良好 (~75%) 少量缺失
GeneralUpdate.Bowl 🟢 良好 (~80%) 少量缺失
GeneralUpdate.Firmware ⚪ 跳过 代码未完成

P1 缺失项(共 13 项)

GeneralUpdate.Core

  • Hubs/UpgradeHubService — Hub 服务核心实现
  • Download/Sources/HttpDownloadSource + OssDownloadSource — 下载源实现
  • Download/Executors/OssDownloadExecutor — OSS 下载执行器
  • Strategy/OssStrategy — OSS 更新策略

GeneralUpdate.Drivelution

  • Core/Execution/CommandRunner — 命令执行器
  • Core/ServiceCollectionExtensions — DI 注册扩展
  • Linux/Implementation/LinuxDriverValidator + Windows/Implementation/WindowsDriverValidator — 平台驱动验证器
  • Linux/Implementation/LinuxGeneralDrivelution + Windows/Implementation/WindowsGeneralDrivelution — 平台入口实现

GeneralUpdate.Extension

  • Core/ExtensionServiceFactory — 扩展服务工厂

GeneralUpdate.Bowl

  • Strategies/ProcessRunner — 进程运行器
  • FileSystem/StorageHelper — 文件存储辅助

修复

已通过 #493 补齐上述所有缺失测试(126 个新测试,14 个文件)。

额外发现

  • ClientTestUpgradeTest 是 Console App(Exe),非测试项目,建议移至 samples/" 或 "tools/ 目录
  • src/c#/ 下的 co-located test 项目与 tests/ 下的同名项目存在部分重复,现已合并

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

featuresNew feature or requestrefactorRefactor some existing code.

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions