mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
merge bitcoin#24195: Fix failfast option for functional test runner
This commit is contained in:
parent
64dd46764c
commit
473ee8ef18
@ -573,8 +573,11 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
|
|||||||
|
|
||||||
max_len_name = len(max(test_list, key=len))
|
max_len_name = len(max(test_list, key=len))
|
||||||
test_count = len(test_list)
|
test_count = len(test_list)
|
||||||
|
all_passed = True
|
||||||
i = 0
|
i = 0
|
||||||
while i < test_count:
|
while i < test_count:
|
||||||
|
if failfast and not all_passed:
|
||||||
|
break
|
||||||
for test_result, testdir, stdout, stderr in job_queue.get_next():
|
for test_result, testdir, stdout, stderr in job_queue.get_next():
|
||||||
test_results.append(test_result)
|
test_results.append(test_result)
|
||||||
i += 1
|
i += 1
|
||||||
@ -584,6 +587,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
|
|||||||
elif test_result.status == "Skipped":
|
elif test_result.status == "Skipped":
|
||||||
logging.debug("%s skipped" % (done_str))
|
logging.debug("%s skipped" % (done_str))
|
||||||
else:
|
else:
|
||||||
|
all_passed = False
|
||||||
print("%s failed, Duration: %s s\n" % (done_str, test_result.time))
|
print("%s failed, Duration: %s s\n" % (done_str, test_result.time))
|
||||||
print(BOLD[1] + 'stdout:\n' + BOLD[0] + stdout + '\n')
|
print(BOLD[1] + 'stdout:\n' + BOLD[0] + stdout + '\n')
|
||||||
print(BOLD[1] + 'stderr:\n' + BOLD[0] + stderr + '\n')
|
print(BOLD[1] + 'stderr:\n' + BOLD[0] + stderr + '\n')
|
||||||
@ -617,7 +621,7 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab
|
|||||||
if not os.listdir(tmpdir):
|
if not os.listdir(tmpdir):
|
||||||
os.rmdir(tmpdir)
|
os.rmdir(tmpdir)
|
||||||
|
|
||||||
all_passed = all(map(lambda test_result: test_result.was_successful, test_results)) and coverage_passed
|
all_passed = all_passed and coverage_passed
|
||||||
|
|
||||||
# Clean up dangling processes if any. This may only happen with --failfast option.
|
# Clean up dangling processes if any. This may only happen with --failfast option.
|
||||||
# Killing the process group will also terminate the current process but that is
|
# Killing the process group will also terminate the current process but that is
|
||||||
|
Loading…
Reference in New Issue
Block a user