Skip to content

Commit

Permalink
Merge pull request #112 from nathan-weinberg/abort-support
Browse files Browse the repository at this point in the history
Added support for jobs with lcb_result 'ABORTED'
  • Loading branch information
nathan-weinberg authored May 27, 2020
2 parents b846615 + 20c4d82 commit 1dc25cb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 12 additions & 3 deletions report.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def run_report(config, blockers, server, header, test, save):
num_unstable = 0
num_failure = 0
num_missing = 0
num_aborted = 0
num_error = 0
rows = []
all_bugs = []
Expand All @@ -58,17 +59,19 @@ def run_report(config, blockers, server, header, test, save):
if jenkins_api_info:

# take action based on last completed build result
if jenkins_api_info['lcb_result'] == "SUCCESS" or jenkins_api_info['lcb_result'] == "NO_KNOWN_BUILDS":
if jenkins_api_info['lcb_result'] in ["SUCCESS", "NO_KNOWN_BUILDS", "ABORTED"]:
if jenkins_api_info['lcb_result'] == "SUCCESS":
num_success += 1
else:
elif jenkins_api_info['lcb_result'] == "NO_KNOWN_BUILDS":
num_missing += 1
else:
num_aborted += 1

bugs = [{'bug_name': 'N/A', 'bug_url': None}]
tickets = [{'ticket_name': 'N/A', 'ticket_url': None}]
other = [{'other_name': 'N/A', 'other_url': None}]

elif jenkins_api_info['lcb_result'] == "UNSTABLE" or jenkins_api_info['lcb_result'] == "FAILURE":
elif jenkins_api_info['lcb_result'] in ["UNSTABLE", "FAILURE"]:
if jenkins_api_info['lcb_result'] == "UNSTABLE":
num_unstable += 1
else:
Expand Down Expand Up @@ -155,6 +158,12 @@ def run_report(config, blockers, server, header, test, save):
else:
summary['total_missing'] = False

# include abort report if needed
if num_aborted > 0:
summary['total_aborted'] = "Total ABORTED: {}/{} = {}%".format(num_aborted, num_jobs, percent(num_aborted, num_jobs))
else:
summary['total_aborted'] = False

# include error report if needed
if num_error > 0:
summary['total_error'] = "Total ERROR: {}/{} = {}%".format(num_error, num_jobs, percent(num_error, num_jobs))
Expand Down
7 changes: 7 additions & 0 deletions report_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,19 @@
<li>{{summary.total_success}}</li>
<li>{{summary.total_unstable}}</li>
<li>{{summary.total_failure}}</li>

{% if summary.total_missing %}
<li>{{summary.total_missing}}</li>
{% endif %}

{% if summary.total_aborted %}
<li>{{summary.total_aborted}}</li>
{% endif %}

{% if summary.total_error %}
<li>{{summary.total_error}}</li>
{% endif %}

<li>{{summary.total_bugs}}</li>
<li>{{summary.total_tickets}}</li>
</ul>
Expand Down

0 comments on commit 1dc25cb

Please sign in to comment.