diff --git a/.github/actions_scripts/test.py b/.github/actions_scripts/test.py index 55ce11b..bfe9707 100644 --- a/.github/actions_scripts/test.py +++ b/.github/actions_scripts/test.py @@ -3,12 +3,18 @@ import os import subprocess +from pathlib import Path from utils import set_action_outputs pypi_name = os.environ["PYPI_NAME"] module_name = os.environ["MODULE_NAME"] + + +current_directory = Path(__file__).parent +print("当前文件所在目录:", current_directory) # noqa: T201 + def check_module(module_name: str) -> bool: """Check module name.""" import importlib @@ -30,7 +36,7 @@ def alicebot_test() -> None: try: # 要执行的 Python 脚本路径 - python_script_path = ".github/actions_scripts/plugin_test.py" + python_script_path = "plugin_test.py" # 整个命令 command = f"python {python_script_path} {module_name}" print(f"command: {command}")# noqa: T201 @@ -103,7 +109,7 @@ def get_meta_info() -> None: alicebot_test() except Exception as e: # noqa: BLE001 print(f"Exception: {e}")# noqa: T201 - set_action_outputs({"result": "error", "output": str(e)}) + set_action_outputs({"result": "error", "output": f"Exception: {e}"}) else: print("get_meta_info")# noqa: T201 get_meta_info()