Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail testing when test-run fails internally #161

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,15 @@ def report_undone(self, verbose):
return False
if verbose:
color_stdout(
'The following tasks were dispatched on some worker task '
'[Internal test-run error] '
'The following tasks were dispatched to some worker task '
'queue, but were not reported as done (does not matters '
'success or fail):\n', schema='test_var')
for task_id in undone:
color_stdout('- %s' % yaml.safe_dump(task_id))
else:
color_stdout("Count of didn't processed tasks: %d\n"
% len(undone), schema='test_var')
# Visually continue StatisticsWatcher.print_statistics() output.
color_stdout('* undone: %d\n' % len(undone), schema='test_var')
return True

def wait(self):
Expand Down
8 changes: 4 additions & 4 deletions test-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ def main_loop_parallel():
dispatcher.wait_processes()
color_stdout('-' * 81, "\n", schema='separator')
has_failed = dispatcher.statistics.print_statistics()
has_undone = dispatcher.report_undone(verbose=is_force)
has_undone = dispatcher.report_undone(verbose=True)
if has_failed:
return EXIT_FAILED_TEST
if is_force and has_undone:
if has_undone:
return EXIT_NOTDONE_TEST
except KeyboardInterrupt:
color_stdout('-' * 81, "\n", schema='separator')
dispatcher.statistics.print_statistics()
dispatcher.report_undone(verbose=is_force)
dispatcher.report_undone(verbose=False)
raise
except HangError:
color_stdout('-' * 81, "\n", schema='separator')
dispatcher.statistics.print_statistics()
dispatcher.report_undone(verbose=is_force)
dispatcher.report_undone(verbose=True)
return EXIT_HANG
return EXIT_SUCCESS

Expand Down