From bd0747f74b68769506a880b22aa1bb20814fffcf Mon Sep 17 00:00:00 2001 From: ut001652 Date: Mon, 21 Oct 2024 21:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BE=8B=E5=89=8D?= =?UTF-8?q?=E7=BD=AE=E5=A4=B1=E8=B4=A5=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=BE=E5=88=B0=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=BF=9C=E7=A8=8B=E6=89=A7?= =?UTF-8?q?=E8=A1=8Cslaves=E8=A2=AB=E9=87=8D=E7=BD=AE=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conftest.py | 3 ++- src/rtk/local_runner.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index bcfed1ea..7d05361e 100644 --- a/conftest.py +++ b/conftest.py @@ -632,7 +632,8 @@ def pytest_runtest_makereport(item, call): else: allure.dynamic.tag(mark.name) if report.outcome == "failed": - write_case_result(item, report) + if write_json(item.session): + write_case_result(item, report) if report.when == "call": logger.info(f"运行结果: {str(report.outcome).upper()}") if write_json(item.session): diff --git a/src/rtk/local_runner.py b/src/rtk/local_runner.py index 9e4a70e4..8de1b8a6 100644 --- a/src/rtk/local_runner.py +++ b/src/rtk/local_runner.py @@ -128,12 +128,13 @@ def __init__( else None, Args.pms_info_file.value: pms_info_file, Args.autostart.value: autostart or GlobalConfig.AUTOSTART, + Args.slaves.value: slaves or GlobalConfig.SLAVES, } self.lastfailed = lastfailed self.project_name = project_name self.build_location = build_location self.line = line - self.slaves = slaves + # self.slaves = slaves self.collection_only = collection_only self.export_csv_file = export_csv_file or GlobalConfig.EXPORT_CSV_FILE @@ -271,8 +272,8 @@ def create_pytest_cmd(self, app_dir, default=None, proj_path=None): cmd.extend(["--repeat", default.get(Args.repeat.value)]) if self.line: cmd.extend(["--line", self.line]) - if self.slaves: - cmd.extend(["--slaves", self.slaves]) + if default.get(Args.slaves.value): + cmd.extend(["--slaves", default.get(Args.slaves.value)]) report_formats = default.get(Args.report_formats.value) if report_formats: