diff --git a/common b/common index d572874..a6beecb 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit d572874a99cb7643119c9be7cb01ce7a4a315d97 +Subproject commit a6beecbbd05ffdfa8364e142e6b6a1d621bd14b3 diff --git a/run.py b/run.py index 804b4bb..2aafa5c 100644 --- a/run.py +++ b/run.py @@ -35,6 +35,7 @@ pytest相关参数:以下也可通过pytest.ini配置 # 标准库导入 import os import shutil +import time # 第三方库导入 import pytest from loguru import logger @@ -95,15 +96,17 @@ def run(env, m, report): pytest.main(args=arg_list) # ------------------------ 生成测试报告 ------------------------ if report == "yes": + _ALLURE_HTML_DIR = f"{ALLURE_HTML_DIR}_{str(int(round(time.time() * 1000)))}" + logger.debug("ALLURE HTML DIR: {}".format(_ALLURE_HTML_DIR)) report_path, attachment_path = generate_allure_report(allure_results=ALLURE_RESULTS_DIR, - allure_report=ALLURE_HTML_DIR, + allure_report=_ALLURE_HTML_DIR, windows_title=REPORT["项目名称"], report_name=REPORT["报告标题"], env_info={ "运行环境": GLOBAL_VARS.get("host", None)}, allure_config_path=ALLURE_CONFIG_DIR, attachment_path=os.path.join(REPORT_DIR, - f'autotest_report.zip')) + f'{_ALLURE_HTML_DIR}.zip')) # ------------------------ 发送测试结果 ------------------------ send_result(report_info=REPORT, report_path=report_path, attachment_path=attachment_path)