Skip to content

Commit a036358

Browse files
committed
test: Repair failfast option for test runner
1 parent d4e92d8 commit a036358

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/test_runner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,11 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
532532

533533
max_len_name = len(max(test_list, key=len))
534534
test_count = len(test_list)
535+
all_passed = True
535536
i = 0
536537
while i < test_count:
538+
if failfast and not all_passed:
539+
break
537540
for test_result, testdir, stdout, stderr in job_queue.get_next():
538541
test_results.append(test_result)
539542
i += 1
@@ -543,6 +546,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
543546
elif test_result.status == "Skipped":
544547
logging.debug("%s skipped" % (done_str))
545548
else:
549+
all_passed = False
546550
print("%s failed, Duration: %s s\n" % (done_str, test_result.time))
547551
print(BOLD[1] + 'stdout:\n' + BOLD[0] + stdout + '\n')
548552
print(BOLD[1] + 'stderr:\n' + BOLD[0] + stderr + '\n')
@@ -576,7 +580,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
576580
if not os.listdir(tmpdir):
577581
os.rmdir(tmpdir)
578582

579-
all_passed = all(map(lambda test_result: test_result.was_successful, test_results)) and coverage_passed
583+
all_passed = all_passed and coverage_passed
580584

581585
# Clean up dangling processes if any. This may only happen with --failfast option.
582586
# Killing the process group will also terminate the current process but that is

0 commit comments

Comments
 (0)