Fix/test_runwork (#2001)
Sequential Lint and Type Check / ruff-call (push) Waiting to run
Sequential Lint and Type Check / pyright-call (push) Blocked by required conditions

* fix(test): 修复测试工作流

- 修改自动更新模块中的导入路径
- 更新插件商店模块中的插件信息获取逻辑
- 优化插件添加、更新和移除流程
- 统一插件相关错误信息的格式
- 调整测试用例以适应新的插件管理逻辑

* test(builtin_plugins): 重构插件商店相关测试

- 移除 jsd 相关测试用例,只保留 gh(GitHub)的测试
- 删除了 test_plugin_store.py 文件,清理了插件商店的测试
- 更新了 test_search_plugin.py 中的插件版本号
- 调整了 test_update_plugin.py 中的已加载插件版本
- 移除了 StoreManager 类中的 is_external 变量
- 更新了 RepoFileManager 类中的文件获取逻辑,优先使用 GitHub
This commit is contained in:
molanp
2025-08-03 18:59:42 +08:00
committed by GitHub
parent 854eac68d8
commit 6d829bcb02
8 changed files with 58 additions and 200 deletions
+11 -10
View File
@@ -207,13 +207,13 @@ class RepoFileManager:
)
if repo_type is None:
try:
return await self.get_aliyun_file_content(
repo_name, file_path, branch, ignore_error
)
except Exception:
return await self.get_github_file_content(
repo_url, file_path, ignore_error
)
except Exception:
return await self.get_aliyun_file_content(
repo_name, file_path, branch, ignore_error
)
try:
if repo_type == RepoType.GITHUB:
@@ -257,17 +257,17 @@ class RepoFileManager:
)
try:
if repo_type is None:
# 尝试阿里云,失败则尝试GitHub
# 尝试GitHub,失败则尝试阿里云
try:
return await self._list_aliyun_directory_files(
repo_name, directory_path, branch, recursive
return await self._list_github_directory_files(
repo_url, directory_path, branch, recursive
)
except Exception as e:
logger.warning(
"获取阿里云目录文件失败,尝试GitHub", LOG_COMMAND, e=e
"获取GitHub目录文件失败,尝试阿里云", LOG_COMMAND, e=e
)
return await self._list_github_directory_files(
repo_url, directory_path, branch, recursive
return await self._list_aliyun_directory_files(
repo_name, directory_path, branch, recursive
)
if repo_type == RepoType.GITHUB:
return await self._list_github_directory_files(
@@ -526,6 +526,7 @@ class RepoFileManager:
content_bytes = content.encode("utf-8")
else:
content_bytes = content
logger.warning(f"写入文件: {local_path}")
async with aiofiles.open(local_path, "wb") as f:
await f.write(content_bytes)
result.success = True