Skip to content

Commit

Permalink
get breakdown of intermittent bug close reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Jun 23, 2015
1 parent cbe4b47 commit 37f1ae9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/templates/index.html
Expand Up @@ -27,6 +27,9 @@
{% endif %}
</div>

</div>
<div id='closedBreakdown' style="display:None">

</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
Expand Down Expand Up @@ -192,6 +195,11 @@
var intermittents = JSON.parse(oReq.response);
document.getElementById('intermittentsClosedWeek').textContent = intermittents.intermittent_count_closed_last_week;
document.getElementById('intermittentsOpenWeek').textContent = intermittents.intermittent_count_last_week;
var closureReason = ""
for (var reason in intermittents.closed_break_down) {
closureReason = closureReason + reason + " " + intermittents.closed_break_down[reason] + "<br>"
}
document.getElementById('closedBreakdown').innerHTML = closureReason;
}
oReq.open("GET",'/intermittents.html', true);
oReq.send();
Expand Down
17 changes: 17 additions & 0 deletions app/tree_controller.py
Expand Up @@ -201,6 +201,23 @@ def _seven_days_ago():

return seven_days_ago, today

def intermittents_closed_breakdown():

seven_days_ago, today = _seven_days_ago()

bugs = _intermittent_bugs(seven_days_ago, today)

result= {}
for bug in bugs:
if bug.resolution == '':
bug.resolution = 'Reopened'
try:
result[bug.resolution] = result[bug.resolution] + 1
except:
result[bug.resolution] = 1

return result

def intermittent_count_closed_last_week():

seven_days_ago, today = _seven_days_ago()
Expand Down
4 changes: 3 additions & 1 deletion app/views.py
Expand Up @@ -71,9 +71,11 @@ def index():
def intermittents():
intermittent_count_last_week = tree_controller.intermittent_opened_count_last_week()
intermittent_count_closed_last_week = tree_controller.intermittent_count_closed_last_week()
intermittents_closed_breakdown = tree_controller.intermittents_closed_breakdown()
intermittents_result = {
"intermittent_count_last_week":intermittent_count_last_week,
"intermittent_count_closed_last_week":intermittent_count_closed_last_week
"intermittent_count_closed_last_week":intermittent_count_closed_last_week,
"closed_break_down": intermittents_closed_breakdown,
}
return jsonify(intermittents_result)

Expand Down

0 comments on commit 37f1ae9

Please sign in to comment.