Skip to content
Open
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
14 changes: 9 additions & 5 deletions cosmic_ray/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def is_killed(record):
elif record.worker_outcome == WorkerOutcome.NORMAL:
if record.test_outcome == TestOutcome.KILLED:
return True
if record.test_outcome == TestOutcome.INCOMPETENT:
return True
return False


Expand All @@ -59,13 +57,17 @@ def create_report(records, show_pending, full_report=False):
"""
total_jobs = 0
pending_jobs = 0
incompetent_jobs = 0
kills = 0
for item in records:
total_jobs += 1
if item.worker_outcome is None:
pending_jobs += 1
if is_killed(item):
kills += 1
else:
if item.test_outcome == TestOutcome.INCOMPETENT:
incompetent_jobs += 1
if is_killed(item):
kills += 1
if (item.worker_outcome is not None) or show_pending:
yield from _print_item(item, full_report)

Expand All @@ -74,8 +76,10 @@ def create_report(records, show_pending, full_report=False):
yield 'total jobs: {}'.format(total_jobs)

if completed_jobs > 0:
yield 'complete: {} ({:.2f}%)'.format(
yield 'completed: {} ({:.2f}%)'.format(
completed_jobs, completed_jobs / total_jobs * 100)
yield 'incompetent: {} ({:.2f}%)'.format(
incompetent_jobs, incompetent_jobs / total_jobs * 100)
yield 'survival rate: {:.2f}%'.format(
(1 - kills / completed_jobs) * 100)
else:
Expand Down
3 changes: 2 additions & 1 deletion docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,6 @@ super useful for seeing how far along a your mutation testing is:
(.venv-pyerf) ~/PyErf$ cosmic-ray exec test_session &
(.venv-pyerf) ~/PyErf$ cosmic-ray dump test_session | cr-report
total jobs: 682
complete: 18 (2.64%)
completed: 18 (2.64%)
incompetent: 0 (0.00%)
survival rate: 0.00%