Skip to content

Commit

Permalink
feat(plugin_test): 简化插件测试输出 (#273)
Browse files Browse the repository at this point in the history
没出错的时候只输出 stdout,并且 show_plugin_dependencies 中只在报错的时候输出。
  • Loading branch information
he0119 authored Nov 19, 2024
1 parent 30ac7fe commit 3beda23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

## [Unreleased]

### Changed

- 简化插件测试输出

## [4.0.2] - 2024-11-19

### Fixed
Expand Down
15 changes: 7 additions & 8 deletions src/providers/docker_test/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ async def create_poetry_project(self):

if self._create:
self._log_output(f"项目 {self.project_link} 创建成功。")

self._std_output(stdout, "")
else:
self._log_output(f"项目 {self.project_link} 创建失败:")
self._std_output(stdout, stderr)

self._std_output(stdout, stderr)
else:
self._log_output(f"项目 {self.project_link} 已存在,跳过创建。")
self._create = True
Expand All @@ -338,10 +338,10 @@ async def show_package_info(self) -> None:

# 记录插件信息至输出
self._log_output(f"插件 {self.project_link} 的信息如下:")
self._std_output(stdout, "")
else:
self._log_output(f"插件 {self.project_link} 信息获取失败。")

self._std_output(stdout, stderr)
self._std_output(stdout, stderr)

async def run_poetry_project(self) -> None:
"""运行插件"""
Expand Down Expand Up @@ -373,10 +373,10 @@ async def run_poetry_project(self) -> None:

if self._run:
self._log_output(f"插件 {self.module_name} 加载正常:")
self._std_output(stdout, "")
else:
self._log_output(f"插件 {self.module_name} 加载出错:")

self._std_output(stdout, stderr)
self._std_output(stdout, stderr)

async def show_plugin_dependencies(self) -> None:
"""获取插件的依赖"""
Expand All @@ -392,8 +392,7 @@ async def show_plugin_dependencies(self) -> None:
self._log_output(f" {', '.join(self._deps)}")
else:
self._log_output(f"插件 {self.project_link} 依赖获取失败。")

self._std_output(stdout, stderr)
self._std_output(stdout, stderr)

@property
def plugin_list(self) -> dict[str, str]:
Expand Down

0 comments on commit 3beda23

Please sign in to comment.