From 59df64c507fef3e03f449f0e81ec26bfbbd1ad9d Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 9 Sep 2024 13:23:34 +0200 Subject: [PATCH] gdgd --- Tools/autotest/autotest.py | 13 ++++++------- Tools/autotest/vehicle_test_suite.py | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index 1c6d650756232..59163af331aa3 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -459,6 +459,7 @@ def run_step(step): return util.build_replay(board='SITL') if vehicle_binary is not None: + print(f"::group::{step}") try: binary = binary_path(step, debug=opts.debug) os.unlink(binary) @@ -719,16 +720,17 @@ def run_tests(steps): passed = True failed = [] failed_testinstances = dict() - should_close_group = False + print("::endgroup::") + for step in steps: - if "build" in step: - should_close_group = True util.pexpect_close_all() t1 = time.time() print(">>>> RUNNING STEP: %s at %s" % (step, time.asctime())) try: success = run_step(step) + if "build" in step: + print("::endgroup::") testinstance = None if isinstance(success, tuple): (success, testinstance) = success @@ -736,9 +738,6 @@ def run_tests(steps): results.add(step, 'PASSED', time.time() - t1) print(">>>> PASSED STEP: %s at %s" % (step, time.asctime())) - if should_close_group: - print("::endgroup::") - should_close_group = False else: print(">>>> FAILED STEP: %s at %s" % (step, time.asctime())) passed = False @@ -752,9 +751,9 @@ def run_tests(steps): except Exception as msg: passed = False failed.append(step) + print("::endgroup::") print(">>>> FAILED STEP: %s at %s (%s)" % (step, time.asctime(), msg)) - print(f"::error file=autotest.py::{msg}") traceback.print_exc(file=sys.stdout) results.add(step, 'FAILED', diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index cffa714ce9949..0687e13683234 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -9052,6 +9052,7 @@ def run_one_test_attempt(self, test, interact=False, attempt=1, suppress_stdout= else: self.progress('FAILED: "%s": %s (see %s)' % (prettyname, repr(ex), test_output_filename)) + print(f"::error::FAILED: {prettyname}: {repr(ex)} (see {test_output_filename})", file=sys.stdout) result.exception = ex result.debug_filename = test_output_filename if interact: @@ -12301,7 +12302,9 @@ def run_tests(self, tests) -> List[Result]: for test in tests: self.drain_mav_unparsed() + print(f"::group::{test.name}") result_list.append(self.run_one_test(test)) + print("::endgroup::") except pexpect.TIMEOUT: self.progress("Failed with timeout") @@ -12312,6 +12315,7 @@ def run_tests(self, tests) -> List[Result]: if self.logs_dir: if glob.glob("core*") or glob.glob("ap-*.core"): self.check_logs("FRAMEWORK") + print("::endgroup::") if self.rc_thread is not None: self.progress("Joining RC thread")