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
1=== modified file 'smokeng/admin.py'
2--- smokeng/admin.py 2013-07-10 16:56:19 +0000
3+++ smokeng/admin.py 2013-08-16 15:27:05 +0000
4@@ -24,11 +24,11 @@
5
6
7 class SmokeImageAdmin(admin.ModelAdmin):
8- list_filter = ['release', 'variant', 'arch']
9+ list_filter = ['publish', 'release', 'variant', 'arch']
10 search_fields = [
11 'build_number',
12 ]
13- list_display = ('build_number', 'variant', 'arch', 'release')
14+ list_display = ('build_number', 'variant', 'arch', 'release', 'publish')
15 ordering = ['-build_number']
16
17
18@@ -41,8 +41,9 @@
19 'pass_count',
20 'total_count',
21 'ran_at',
22+ 'publish',
23 )
24- list_filter = ['name']
25+ list_filter = ['publish', 'name']
26 search_fields = ['name']
27 date_hierarchy = 'ran_at'
28 ordering = ['image']
29
30=== modified file 'smokeng/models.py'
31--- smokeng/models.py 2013-07-30 21:05:41 +0000
32+++ smokeng/models.py 2013-08-16 15:27:05 +0000
33@@ -68,6 +68,12 @@
34 'jenkins_build__job__url',
35 'jenkins_build__build_number',
36 )
37+ crash_count = self.smokeresult_set.filter(
38+ publish=True,
39+ jenkins_build__artifact__name__contains='crash',
40+ ).values(
41+ 'id',
42+ )
43
44 bugs = SmokeResultBug.objects.filter(
45 result__image=self
46@@ -100,6 +106,7 @@
47 passrates = []
48 for r in results:
49 r['bugs'] = []
50+ r['crash_count'] = 0
51 data['pass_count'] += r['pass_count']
52 data['fail_count'] += r['fail_count']
53 data['error_count'] += r['error_count']
54@@ -113,6 +120,11 @@
55 for b in bugs:
56 if b['result__id'] == r['id']:
57 r['bugs'].append(b['bug__bug_no'])
58+
59+ for crashes in crash_count:
60+ if crashes['id'] == r['id']:
61+ r['crash_count'] += 1
62+
63 results_copy.append(r)
64
65 if len(passrates) == 0:
66
67=== modified file 'smokeng/tables.py'
68--- smokeng/tables.py 2013-08-16 14:59:45 +0000
69+++ smokeng/tables.py 2013-08-16 15:27:05 +0000
70@@ -25,6 +25,7 @@
71 'pass_count',
72 'fail_count',
73 'error_count',
74+ 'crash_count',
75 'pass_rate',
76 'bugs',
77 )
78@@ -48,6 +49,10 @@
79 verbose_name='error',
80 attrs={'td': {'class': 'num'}},
81 )
82+ crash_count = tables.Column(
83+ verbose_name='Crashes',
84+ attrs={'td': {'class': 'num'}},
85+ )
86 pass_rate = tables.TemplateColumn(
87 '{% load dashboard_extras %}'
88 '{{ record.pass_rate|decimal_to_percent }}',
89@@ -100,25 +105,6 @@
90 },
91 )
92 ran_at = tables.Column()
93- logs = tables.TemplateColumn(
94- '{% if image.variant == "touch" and build_number >= "20130730" %}'
95- '<a href="{{ record.jenkins_build__job__url }}'
96- '{{ record.jenkins_build__build_number }}'
97- '/artifact/clientlogs/dmesg.log/*view*/">'
98- 'dmesg</a>'
99- '&nbsp;&nbsp;&nbsp;'
100- '<a href="{{ record.jenkins_build__job__url }}'
101- '{{ record.jenkins_build__build_number }}'
102- '/artifact/clientlogs/">Artifacts</a>'
103- '{% else %}'
104- '<a href="{{ record.jenkins_build__job__url }}'
105- '{{ record.jenkins_build__build_number }}/artifact/">Artifacts</a>'
106- '{% endif %}'
107- '&nbsp;&nbsp;&nbsp;'
108- '<a href="{{ record.jenkins_build__job__url }}'
109- '{{ record.jenkins_build__build_number }}/console">Console Log</a>',
110- sortable=False
111- )
112
113
114 class SmokeKPITable(tables.Table):
115
116=== modified file 'smokeng/views.py'
117--- smokeng/views.py 2013-08-07 14:25:40 +0000
118+++ smokeng/views.py 2013-08-16 15:27:05 +0000
119@@ -30,7 +30,6 @@
120 )
121
122 from common.views import index
123-
124 from common.templatetags.dashboard_extras import decimal_to_percent
125
126 from smokeng.models import (
127@@ -64,17 +63,15 @@
128 ]
129
130
131-def get_totals(
132- results,
133- release,
134-):
135+def get_totals(results, release):
136 totals = {}
137 passrates = {}
138
139 bugs = _get_bugs(release)
140+ crashes = _get_crashes()
141 bug_data = {}
142 for result in results:
143- _append_totals(totals, result)
144+ _append_totals(totals, result, crashes)
145 if result['total_count'] == 0:
146 passrate = 0
147 else:
148@@ -105,6 +102,18 @@
149 return totals, bug_data
150
151
152+def _get_crashes():
153+ crashes = SmokeResult.objects.filter(
154+ publish=True,
155+ jenkins_build__artifact__name__contains='crash',
156+ ).values(
157+ 'image__build_number',
158+ 'image__arch',
159+ 'image__variant',
160+ )
161+ return crashes
162+
163+
164 def _get_bugs(release):
165
166 bugs = SmokeResultBug.objects.filter(
167@@ -113,7 +122,7 @@
168 return bugs
169
170
171-def _append_totals(totals, result):
172+def _append_totals(totals, result, crashes):
173 key = result['image__id']
174
175 if key not in totals:
176@@ -126,8 +135,18 @@
177 error_count=0,
178 bugs=[],
179 name=result['name'],
180+ crash_count=0,
181 )
182
183+ for crash in crashes:
184+ build_number = crash['image__build_number']
185+ if (
186+ build_number == result['image__build_number'] and
187+ crash['image__arch'] == result['image__arch'] and
188+ crash['image__variant'] == result['image__variant']
189+ ):
190+ totals[key]['crash_count'] += 1
191+
192 if 'image__variant' in result:
193 totals[key]['variant'] = result['image__variant']
194
195@@ -174,6 +193,7 @@
196 'image__release',
197 'name',
198 'ran_at',
199+ 'jenkins_build',
200 ).annotate(
201 pass_count=models.Sum('pass_count'),
202 fail_count=models.Sum('fail_count'),
203@@ -187,6 +207,7 @@
204 'image__release',
205 'name',
206 'ran_at',
207+ 'jenkins_build',
208 'pass_count',
209 'fail_count',
210 'error_count',

Subscribers

People subscribed via source and target branches