Skip to content

Commit 2d1a71b

Browse files
authored
Merge pull request #3527 from vkarak/bugfix/xfail-failure-info
[bugfix] Fix failure report crash in case of expected failures
2 parents 4814784 + 4225727 commit 2d1a71b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

reframe/frontend/printer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def _print_failure_info(rec, runid, total_runs):
179179
continue
180180

181181
for r in run_info['testcases']:
182-
if r['result'] in {'pass', 'abort', 'skip', 'fail_deps'}:
182+
if r['result'] in {'pass', 'xfail', 'abort',
183+
'skip', 'fail_deps'}:
183184
continue
184185

185186
_print_failure_info(r, run_no, len(report['runs']))

unittests/test_cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,17 @@ def test_check_failure(run_reframe):
280280
assert returncode != 0
281281

282282

283+
def test_check_xfailures(run_reframe):
284+
returncode, stdout, _ = run_reframe(
285+
checkpath=['unittests/resources/checks_unlisted/xfailures.py']
286+
)
287+
assert returncode != 0
288+
assert 'FAILED' in stdout
289+
assert 'Ran 8/8 test case(s)' in stdout
290+
assert '4 failure(s), 2 expected failure(s)' in stdout
291+
assert 'Traceback' not in stdout
292+
293+
283294
def test_check_setup_failure(run_reframe):
284295
returncode, stdout, stderr = run_reframe(
285296
checkpath=['unittests/resources/checks/frontend_checks.py'],

0 commit comments

Comments
 (0)