test(plugin): 覆盖集合来源多插件导入 - #61
Open
ShadowLemoon wants to merge 1 commit into
Open
Conversation
Summary by CodeRabbit
Walkthrough新增插件导入服务、应用工厂扫描和已安装插件映射测试。测试覆盖目录与压缩包导入、路径安全、符号链接、回滚、批量处理及元数据解析。 Changes插件预览与测试夹具
目录导入与删除安全
压缩包导入生命周期
应用发现与已安装插件映射
Estimated code review effort: 4 (Complex) | ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py (1)
286-293: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win故障注入替身耦合私有临时目录命名前缀。 两处替身都用
.<插件名>.tmp-前缀判断是否抛出异常,并且没有断言注入确实触发。如果生产代码更改临时目录命名,条件永不命中,导入会正常成功,回滚与隔离断言会静默失效。
test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py#L286-L293:在fail_staging_replace中记录注入标志,并在断言块补充assert triggered。test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py#L471-L484:在fail_broken与fail_broken_cleanup中记录注入标志,并在断言块确认两者均已触发。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py` around lines 286 - 293, 更新 test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py 的 286-293 行,在 fail_staging_replace 中记录是否实际触发异常,并在对应断言块增加 assert triggered;同时更新 471-484 行的 fail_broken 与 fail_broken_cleanup,分别记录触发状态,并在断言块确认两者均已触发,避免仅依赖临时目录命名前缀而导致故障注入静默失效。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py`:
- Around line 286-293: 更新
test/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.py
的 286-293 行,在 fail_staging_replace 中记录是否实际触发异常,并在对应断言块增加 assert triggered;同时更新
471-484 行的 fail_broken 与
fail_broken_cleanup,分别记录触发状态,并在断言块确认两者均已触发,避免仅依赖临时目录命名前缀而导致故障注入静默失效。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2d598890-5c7a-4373-a544-7c7060225b7e
📒 Files selected for processing (7)
test/one_dragon/base/operation/application/application_factory_manager/test_scan_directory.pytest/one_dragon/base/operation/application/plugin_import_service/conftest.pytest/one_dragon/base/operation/application/plugin_import_service/test_delete_plugin.pytest/one_dragon/base/operation/application/plugin_import_service/test_import_directory.pytest/one_dragon/base/operation/application/plugin_import_service/test_import_plugin.pytest/one_dragon/base/operation/application/plugin_import_service/test_preview_plugin.pytest/zzz_od/gui/view/setting/setting_plugin_interface/test_get_installed_plugins_by_package.py
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.
为什么改
为 OneDragon-Anything/ZenlessZoneZero-OneDragon#2097 的集合 ZIP、松散集合目录导入与第三方插件扫描边界提供配套回归测试。
改动要点
关联