From 3beda23140d6e2a6067f57a0c924b4413d145ecd Mon Sep 17 00:00:00 2001 From: uy/sun Date: Tue, 19 Nov 2024 22:33:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugin=5Ftest):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=B5=8B=E8=AF=95=E8=BE=93=E5=87=BA=20(#273)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 没出错的时候只输出 stdout,并且 show_plugin_dependencies 中只在报错的时候输出。 --- CHANGELOG.md | 4 ++++ src/providers/docker_test/plugin_test.py | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aeaeded..55d38ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/providers/docker_test/plugin_test.py b/src/providers/docker_test/plugin_test.py index 6983f938..c508b1ac 100644 --- a/src/providers/docker_test/plugin_test.py +++ b/src/providers/docker_test/plugin_test.py @@ -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 @@ -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: """运行插件""" @@ -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: """获取插件的依赖""" @@ -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]: