Skip to content

Commit 2d46c28

Browse files
authored
fix: 修复测试中输出插件测试结果不完善的问题 (#271)
* fix: 修复商店测试中输出插件测试结果不完善的问题 * fix: 修复发布测试中输出插件测试结果不完善的问题 * docs: 更新 CHANGELOG
1 parent 1e5b23f commit 2d46c28

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
1111

1212
- 修复商店测试中获取 PyPI 数据出错会直接退出的问题
1313
- 修复商店测试时出现缺少 author_id 报错的问题
14+
- 修复测试中输出插件测试结果不完善的问题
1415

1516
## [4.0.1] - 2024-11-18
1617

src/plugins/github/plugins/publish/validation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,14 @@ async def validate_plugin_info_from_issue(
107107
raw_data["test_output"] = test_output
108108
raw_data["metadata"] = bool(metadata)
109109

110-
logger.info(f"插件测试结果: {test_result}")
111-
logger.info(f"插件元数据: {metadata}")
110+
# 输出插件测试相关信息
111+
logger.info(
112+
f"插件 {project_link}({test_result.version}) 加载{'成功' if test_result.load else '失败'},运行{'开始' if test_result.run else '失败'}"
113+
)
114+
logger.info(f"插件元数据:{metadata}")
115+
logger.info("插件测试输出:")
116+
for output in test_output:
117+
logger.info(output)
112118

113119
# 验证插件相关信息
114120
result = validate_info(PublishType.PLUGIN, raw_data, previous_data)

src/providers/store_test/validation.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,21 @@ async def validate_plugin(
4343
"3.12"
4444
)
4545

46-
# 获取测试结果
47-
click.echo(f"测试结果:{plugin_test_result}")
4846
plugin_test_load = plugin_test_result.load
4947
plugin_test_output = "\n".join(plugin_test_result.outputs)
5048
plugin_test_version = plugin_test_result.version
5149
plugin_test_env = plugin_test_result.test_env
5250
plugin_metadata = plugin_test_result.metadata
5351

52+
# 输出插件测试相关信息
53+
click.echo(
54+
f"插件 {project_link}({plugin_test_version}) 加载{'成功' if plugin_test_load else '失败'},运行{'开始' if plugin_test_result.run else '失败'}"
55+
)
56+
click.echo(f"插件元数据:{plugin_metadata}")
57+
click.echo("插件测试输出:")
58+
for output in plugin_test_output:
59+
click.echo(output)
60+
5461
if previous_plugin is None:
5562
# 使用商店插件数据作为新的插件数据
5663
raw_data = store_plugin.model_dump()

0 commit comments

Comments
 (0)