Skip to content
Merged
Changes from 3 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
49 changes: 32 additions & 17 deletions colcon_output/event_handler/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,47 +71,62 @@ def _print_summary(self):
duration = time.monotonic() - self._start_time
duration_string = format_duration(duration)

count, job_type, _ = _msg_arguments(
self._ended - self._interrupted - self._failed)
blocked_jobs = self._queued - self._ended

# convert jobs to package names
ended = {j.task_context.pkg for j in self._ended}
interrupted = {j.task_context.pkg for j in self._interrupted}
failed = {j.task_context.pkg for j in self._failed}
with_stderr = {j.task_context.pkg for j in self._with_stderr}
with_test_failures = {
j.task_context.pkg for j in self._with_test_failures}
blocked = {j.task_context.pkg for j in blocked_jobs}

# packages with successful jobs and blocked jobs are "interrupted"
interrupted |= ended & blocked - failed
Comment thread
cottsay marked this conversation as resolved.

# truly "blocked" packages have no jobs attempted
blocked -= ended

count, job_type, _ = _msg_arguments(ended - interrupted - failed)
print('Summary: {count} {job_type} finished '
'[{duration_string}]'.format_map(locals()))

if self._failed:
count, job_type, names = _msg_arguments(self._failed)
if failed:
count, job_type, names = _msg_arguments(failed)
print(' {count} {job_type} failed: {names}'
.format_map(locals()))

if self._interrupted:
count, job_type, names = _msg_arguments(self._interrupted)
if interrupted:
count, job_type, names = _msg_arguments(interrupted)
print(' {count} {job_type} aborted: {names}'
.format_map(locals()))

if self._with_stderr:
count, job_type, names = _msg_arguments(self._with_stderr)
if with_stderr:
count, job_type, names = _msg_arguments(with_stderr)
print(
' {count} {job_type} had stderr output: {names}'
.format_map(locals()))

if self._with_test_failures:
count, job_type, names = _msg_arguments(
self._with_test_failures)
if with_test_failures:
count, job_type, names = _msg_arguments(with_test_failures)
print(
' {count} {job_type} had test failures: {names}'
.format_map(locals()))

if len(self._queued) > len(self._ended):
count = len(self._queued - self._ended)
if blocked:
count = len(blocked)
job_type = get_job_type_word_form(count)
print(
' {count} {job_type} not processed'
.format_map(locals()))


def _msg_arguments(jobs):
def _msg_arguments(packages):
return (
len(jobs),
get_job_type_word_form(len(jobs)),
' '.join(sorted(j.task.context.pkg.name for j in jobs)),
len(packages),
get_job_type_word_form(len(packages)),
' '.join(sorted(p.name for p in packages)),
)


Expand Down
Loading