Skip to content

Commit

Permalink
tests: properly log the reason why a test got unexpectedly skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-schwartz committed Jan 12, 2023
1 parent 6bfe5d3 commit 901dc34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run_project_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,14 +1330,15 @@ def tqdm_print(*args: mlog.TV_Loggable, sep: str = ' ') -> None:
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'
status = TestStatus.UNEXRUN
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
Expand Down

0 comments on commit 901dc34

Please sign in to comment.