test: 提升单元测试覆盖率至80% - #857
Open
nekoili wants to merge 6 commits into
Open
Conversation
…s/SqlUtils/AesEncryptUtils 单元测试
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #857 +/- ##
============================================
+ Coverage 57.20% 57.97% +0.77%
- Complexity 1702 1753 +51
============================================
Files 269 269
Lines 11241 11241
Branches 594 594
============================================
+ Hits 6430 6517 +87
+ Misses 4577 4499 -78
+ Partials 234 225 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- AttachmentOperatorTest: operator 包 22 个用例, 覆盖率达 100% - StaticServiceImplTest: statics 包 6 个用例, 覆盖率 35% → 80% - DefaultCustomSchemeManagerTest: custom.scheme 包 9 个用例 - DefaultCustomSchemeWatcherManagerTest: 6 个用例 - LogoutSuccessHandlerTest: logout 包 1 个用例 总体: 54% → 55%
…ve 方法 tag 包覆盖率 40% → 51%
…单元测试 subject 核心操作层 14 个用例 - 覆盖 SubjectOperator、SubjectRelationOperator、SubjectSyncOperator - 删除之前失败的 AttachmentServiceImplMoreTest
新增以下服务的单元测试: - TotpService: TOTP验证码生成与验证 - DefaultThemeService: 主题查询 - DefaultSettingService: 全局设置查询 - NotifyServiceImpl: 邮件通知发送 - MailServiceImpl: 邮件配置更新 - AttachmentDriverServiceImpl: 附件驱动CRUD与列表 - DefaultCollectionService: 收藏列表与类型查询
- 修正 AesEncryptUtilsTest 方法签名不匹配 - 修复 LuceneSubjectSearchServiceTest API 用法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
当前项目整体测试覆盖率较低(约54%),需要提升至80%以上以保证代码质量和可维护性。
目标
逐步为各个模块编写测试用例,提升整体覆盖率至80%以上。
本次变更
infra/utils 模块
新增 7 个工具类测试文件:
共约 75 个测试用例。
工作流
每个测试用例单独编译运行,通过后写下一个;单模块完成后跑全量测试检查覆盖率,针对未覆盖部分补充用例,循环直到达到80%。
Closes #(待补充)