Merge lp:~cjohnston/qa-dashboard/1207205 into lp:qa-dashboard

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 580
Merged at revision: 578
Proposed branch: lp:~cjohnston/qa-dashboard/1207205
Merge into: lp:qa-dashboard
Diff against target: 210 lines (+49/-29)
4 files modified
smokeng/admin.py (+4/-3)
smokeng/models.py (+12/-0)
smokeng/tables.py (+5/-19)
smokeng/views.py (+28/-7)
To merge this branch: bzr merge lp:~cjohnston/qa-dashboard/1207205
Reviewer Review Type Date Requested Status
Chris Johnston Approve
Andy Doan (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+180563@code.launchpad.net

Commit message

Add crash count to first and second smoke pages

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:576
http://s-jenkins:8080/job/dashboard-ci/155/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/155/rebuild

review: Approve (continuous-integration)
lp:~cjohnston/qa-dashboard/1207205 updated
577. By Chris Johnston

Remove all the extra queries

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
lp:~cjohnston/qa-dashboard/1207205 updated
578. By Chris Johnston

Minor cleanup

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:577
http://s-jenkins:8080/job/dashboard-ci/156/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/156/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andy Doan (doanac) wrote :

from models.py:

29 +
30 + for crashes in crash_count:
31 + if crashes['id'] == r['id']:
32 + r['crash_count'] += len(crashes)
33 +

does line 32 there need to change to "+= 1" like you've done in views.py?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:578
http://s-jenkins:8080/job/dashboard-ci/158/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/158/rebuild

review: Approve (continuous-integration)
lp:~cjohnston/qa-dashboard/1207205 updated
579. By Chris Johnston

By variant

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
lp:~cjohnston/qa-dashboard/1207205 updated
580. By Chris Johnston

Addresses Andy's comment about +1 v len

Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
Revision history for this message
Andy Doan (doanac) :
review: Approve
Revision history for this message
Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'smokeng/admin.py'
--- smokeng/admin.py 2013-07-10 16:56:19 +0000
+++ smokeng/admin.py 2013-08-16 15:27:05 +0000
@@ -24,11 +24,11 @@
2424
2525
26class SmokeImageAdmin(admin.ModelAdmin):26class SmokeImageAdmin(admin.ModelAdmin):
27 list_filter = ['release', 'variant', 'arch']27 list_filter = ['publish', 'release', 'variant', 'arch']
28 search_fields = [28 search_fields = [
29 'build_number',29 'build_number',
30 ]30 ]
31 list_display = ('build_number', 'variant', 'arch', 'release')31 list_display = ('build_number', 'variant', 'arch', 'release', 'publish')
32 ordering = ['-build_number']32 ordering = ['-build_number']
3333
3434
@@ -41,8 +41,9 @@
41 'pass_count',41 'pass_count',
42 'total_count',42 'total_count',
43 'ran_at',43 'ran_at',
44 'publish',
44 )45 )
45 list_filter = ['name']46 list_filter = ['publish', 'name']
46 search_fields = ['name']47 search_fields = ['name']
47 date_hierarchy = 'ran_at'48 date_hierarchy = 'ran_at'
48 ordering = ['image']49 ordering = ['image']
4950
=== modified file 'smokeng/models.py'
--- smokeng/models.py 2013-07-30 21:05:41 +0000
+++ smokeng/models.py 2013-08-16 15:27:05 +0000
@@ -68,6 +68,12 @@
68 'jenkins_build__job__url',68 'jenkins_build__job__url',
69 'jenkins_build__build_number',69 'jenkins_build__build_number',
70 )70 )
71 crash_count = self.smokeresult_set.filter(
72 publish=True,
73 jenkins_build__artifact__name__contains='crash',
74 ).values(
75 'id',
76 )
7177
72 bugs = SmokeResultBug.objects.filter(78 bugs = SmokeResultBug.objects.filter(
73 result__image=self79 result__image=self
@@ -100,6 +106,7 @@
100 passrates = []106 passrates = []
101 for r in results:107 for r in results:
102 r['bugs'] = []108 r['bugs'] = []
109 r['crash_count'] = 0
103 data['pass_count'] += r['pass_count']110 data['pass_count'] += r['pass_count']
104 data['fail_count'] += r['fail_count']111 data['fail_count'] += r['fail_count']
105 data['error_count'] += r['error_count']112 data['error_count'] += r['error_count']
@@ -113,6 +120,11 @@
113 for b in bugs:120 for b in bugs:
114 if b['result__id'] == r['id']:121 if b['result__id'] == r['id']:
115 r['bugs'].append(b['bug__bug_no'])122 r['bugs'].append(b['bug__bug_no'])
123
124 for crashes in crash_count:
125 if crashes['id'] == r['id']:
126 r['crash_count'] += 1
127
116 results_copy.append(r)128 results_copy.append(r)
117129
118 if len(passrates) == 0:130 if len(passrates) == 0:
119131
=== modified file 'smokeng/tables.py'
--- smokeng/tables.py 2013-08-16 14:59:45 +0000
+++ smokeng/tables.py 2013-08-16 15:27:05 +0000
@@ -25,6 +25,7 @@
25 'pass_count',25 'pass_count',
26 'fail_count',26 'fail_count',
27 'error_count',27 'error_count',
28 'crash_count',
28 'pass_rate',29 'pass_rate',
29 'bugs',30 'bugs',
30 )31 )
@@ -48,6 +49,10 @@
48 verbose_name='error',49 verbose_name='error',
49 attrs={'td': {'class': 'num'}},50 attrs={'td': {'class': 'num'}},
50 )51 )
52 crash_count = tables.Column(
53 verbose_name='Crashes',
54 attrs={'td': {'class': 'num'}},
55 )
51 pass_rate = tables.TemplateColumn(56 pass_rate = tables.TemplateColumn(
52 '{% load dashboard_extras %}'57 '{% load dashboard_extras %}'
53 '{{ record.pass_rate|decimal_to_percent }}',58 '{{ record.pass_rate|decimal_to_percent }}',
@@ -100,25 +105,6 @@
100 },105 },
101 )106 )
102 ran_at = tables.Column()107 ran_at = tables.Column()
103 logs = tables.TemplateColumn(
104 '{% if image.variant == "touch" and build_number >= "20130730" %}'
105 '<a href="{{ record.jenkins_build__job__url }}'
106 '{{ record.jenkins_build__build_number }}'
107 '/artifact/clientlogs/dmesg.log/*view*/">'
108 'dmesg</a>'
109 '&nbsp;&nbsp;&nbsp;'
110 '<a href="{{ record.jenkins_build__job__url }}'
111 '{{ record.jenkins_build__build_number }}'
112 '/artifact/clientlogs/">Artifacts</a>'
113 '{% else %}'
114 '<a href="{{ record.jenkins_build__job__url }}'
115 '{{ record.jenkins_build__build_number }}/artifact/">Artifacts</a>'
116 '{% endif %}'
117 '&nbsp;&nbsp;&nbsp;'
118 '<a href="{{ record.jenkins_build__job__url }}'
119 '{{ record.jenkins_build__build_number }}/console">Console Log</a>',
120 sortable=False
121 )
122108
123109
124class SmokeKPITable(tables.Table):110class SmokeKPITable(tables.Table):
125111
=== modified file 'smokeng/views.py'
--- smokeng/views.py 2013-08-07 14:25:40 +0000
+++ smokeng/views.py 2013-08-16 15:27:05 +0000
@@ -30,7 +30,6 @@
30)30)
3131
32from common.views import index32from common.views import index
33
34from common.templatetags.dashboard_extras import decimal_to_percent33from common.templatetags.dashboard_extras import decimal_to_percent
3534
36from smokeng.models import (35from smokeng.models import (
@@ -64,17 +63,15 @@
64 ]63 ]
6564
6665
67def get_totals(66def get_totals(results, release):
68 results,
69 release,
70):
71 totals = {}67 totals = {}
72 passrates = {}68 passrates = {}
7369
74 bugs = _get_bugs(release)70 bugs = _get_bugs(release)
71 crashes = _get_crashes()
75 bug_data = {}72 bug_data = {}
76 for result in results:73 for result in results:
77 _append_totals(totals, result)74 _append_totals(totals, result, crashes)
78 if result['total_count'] == 0:75 if result['total_count'] == 0:
79 passrate = 076 passrate = 0
80 else:77 else:
@@ -105,6 +102,18 @@
105 return totals, bug_data102 return totals, bug_data
106103
107104
105def _get_crashes():
106 crashes = SmokeResult.objects.filter(
107 publish=True,
108 jenkins_build__artifact__name__contains='crash',
109 ).values(
110 'image__build_number',
111 'image__arch',
112 'image__variant',
113 )
114 return crashes
115
116
108def _get_bugs(release):117def _get_bugs(release):
109118
110 bugs = SmokeResultBug.objects.filter(119 bugs = SmokeResultBug.objects.filter(
@@ -113,7 +122,7 @@
113 return bugs122 return bugs
114123
115124
116def _append_totals(totals, result):125def _append_totals(totals, result, crashes):
117 key = result['image__id']126 key = result['image__id']
118127
119 if key not in totals:128 if key not in totals:
@@ -126,8 +135,18 @@
126 error_count=0,135 error_count=0,
127 bugs=[],136 bugs=[],
128 name=result['name'],137 name=result['name'],
138 crash_count=0,
129 )139 )
130140
141 for crash in crashes:
142 build_number = crash['image__build_number']
143 if (
144 build_number == result['image__build_number'] and
145 crash['image__arch'] == result['image__arch'] and
146 crash['image__variant'] == result['image__variant']
147 ):
148 totals[key]['crash_count'] += 1
149
131 if 'image__variant' in result:150 if 'image__variant' in result:
132 totals[key]['variant'] = result['image__variant']151 totals[key]['variant'] = result['image__variant']
133152
@@ -174,6 +193,7 @@
174 'image__release',193 'image__release',
175 'name',194 'name',
176 'ran_at',195 'ran_at',
196 'jenkins_build',
177 ).annotate(197 ).annotate(
178 pass_count=models.Sum('pass_count'),198 pass_count=models.Sum('pass_count'),
179 fail_count=models.Sum('fail_count'),199 fail_count=models.Sum('fail_count'),
@@ -187,6 +207,7 @@
187 'image__release',207 'image__release',
188 'name',208 'name',
189 'ran_at',209 'ran_at',
210 'jenkins_build',
190 'pass_count',211 'pass_count',
191 'fail_count',212 'fail_count',
192 'error_count',213 'error_count',

Subscribers

People subscribed via source and target branches