From 901dc34ed5971eb435aedf6feb14528d8225b578 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 10 Jan 2023 23:00:36 -0500 Subject: [PATCH] tests: properly log the reason why a test got unexpectedly skipped --- run_project_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run_project_tests.py b/run_project_tests.py index ce913f951..99e49788f 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -1330,7 +1330,7 @@ def _run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]], if not skip_as_expected: failing_tests += 1 if is_skipped: - skip_msg = 'Test asked to be skipped, but was not expected to' + skip_msg = f'Test asked to be skipped ({skip_reason}), but was not expected to' status = TestStatus.UNEXSKIP else: skip_msg = 'Test ran, but was expected to be skipped' @@ -1338,6 +1338,7 @@ def _run_tests(all_tests: T.List[T.Tuple[str, T.List[TestDef], bool]], result.msg = f"{skip_msg} for MESON_CI_JOBNAME '{ci_jobname}'" f.update_log(status) + safe_print(bold('Reason:'), result.msg) current_test = ET.SubElement(current_suite, 'testcase', {'name': testname, 'classname': t.category}) ET.SubElement(current_test, 'failure', {'message': result.msg}) continue