Merge lp:~deeptik/lava-dashboard/test_result_view_work into lp:lava-dashboard

Proposed by Deepti B. Kalakeri on 2010-12-23
Status: Merged
Merged at revision: 134
Proposed branch: lp:~deeptik/lava-dashboard/test_result_view_work
Merge into: lp:lava-dashboard
Diff against target: 240 lines (+174/-4)
6 files modified
dashboard_app/models.py (+5/-0)
dashboard_app/urls.py (+3/-0)
dashboard_app/views.py (+16/-1)
dashboard_server/templates/dashboard_app/test_result_detail.html (+66/-0)
dashboard_server/templates/dashboard_app/test_run_detail.html (+4/-3)
example_bundles/test_result_detail.json (+80/-0)
To merge this branch: bzr merge lp:~deeptik/lava-dashboard/test_result_view_work
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) 2010-12-23 Needs Fixing on 2010-12-23
Review via email: mp+44575@code.launchpad.net

Description of the change

Outline of the Test Result details view.
Please review and let me know your comments.

Thanks!!!
Deepti.

To post a comment you must log in.
Zygmunt Krynicki (zyga) wrote :

Overall looks good but you seem to have missed to bzr add the template file: dashboard_app/test_result_detail.html.

review: Needs Fixing
Deepti B. Kalakeri (deeptik) wrote :

On Thursday 23 December 2010 07:46 PM, Zygmunt Krynicki wrote:
> Review: Needs Fixing
> Overall looks good but you seem to have missed to bzr add the template file: dashboard_app/test_result_detail.html.
>
>
>
oops! I am sorry for missing it, I have added it and pushed it to the
same branch.
Please review it.

Thanks and Regards,
Deepti.

121. By Deepti B. Kalakeri on 2010-12-23

Adding the missing template changes for test result display view

122. By Deepti B. Kalakeri on 2010-12-23

Adding a simple json development data set for test result detail view

123. By Deepti B. Kalakeri on 2010-12-23

Improving the test run detail view

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dashboard_app/models.py'
2--- dashboard_app/models.py 2010-12-20 11:52:16 +0000
3+++ dashboard_app/models.py 2010-12-23 19:53:10 +0000
4@@ -735,3 +735,8 @@
5 (duration.days * 24 * 60 * 60 * 10 ** 6))
6
7 duration = property(_get_duration, _set_duration)
8+
9+ @models.permalink
10+ def get_absolute_url(self):
11+ return ("dashboard_app.views.test_result_detail",
12+ [self.pk])
13
14=== modified file 'dashboard_app/urls.py'
15--- dashboard_app/urls.py 2010-12-13 13:08:20 +0000
16+++ dashboard_app/urls.py 2010-12-23 19:53:10 +0000
17@@ -27,11 +27,14 @@
18 restricted_view,
19 dashboard_xml_rpc_handler,
20 test_run_detail,
21+ test_result_detail,
22 )
23
24 urlpatterns = patterns('',
25 url(r'^streams/$', bundle_stream_list,
26 name='dashboard_app.bundle_stream_list'),
27+ url(r'^test-results/(?P<pk>[0-9]+)/$',
28+ test_result_detail, name='dashboard_app.views.test_result_detail'),
29 url(r'^test-runs/(?P<analyzer_assigned_uuid>[a-zA-Z0-9-]+)/$',
30 test_run_detail, name='dashboard_app.views.test_run_detail'),
31 url(r'^streams(?P<pathname>/[a-zA-Z0-9/-]+/)$', bundle_stream_detail,
32
33=== modified file 'dashboard_app/views.py'
34--- dashboard_app/views.py 2010-12-21 16:02:22 +0000
35+++ dashboard_app/views.py 2010-12-23 19:53:10 +0000
36@@ -31,7 +31,7 @@
37 from django.template import RequestContext
38
39 from dashboard_app.dispatcher import DjangoXMLRPCDispatcher
40-from dashboard_app.models import (Bundle, BundleStream, TestRun)
41+from dashboard_app.models import (Bundle, BundleStream, TestRun, TestResult)
42 from dashboard_app.xmlrpc import DashboardAPI
43
44
45@@ -155,6 +155,21 @@
46 resp.status_code = 403
47 return resp
48
49+def test_result_detail(request, pk):
50+ test_result = get_object_or_404(TestResult, pk=pk)
51+ if test_result.test_run.bundle.bundle_stream.can_access(request.user):
52+ return list_detail.object_detail(
53+ request,
54+ slug_field = 'id',
55+ slug = pk,
56+ queryset = TestResult.objects.all(),
57+ template_name = 'dashboard_app/test_result_detail.html',
58+ template_object_name = 'test_result',
59+ )
60+ else:
61+ resp = render_to_response("403.html", RequestContext(request))
62+ resp.status_code = 403
63+ return resp
64
65 def auth_test(request):
66 response = HttpResponse(mimetype="text/plain")
67
68=== added file 'dashboard_server/templates/dashboard_app/test_result_detail.html'
69--- dashboard_server/templates/dashboard_app/test_result_detail.html 1970-01-01 00:00:00 +0000
70+++ dashboard_server/templates/dashboard_app/test_result_detail.html 2010-12-23 19:53:10 +0000
71@@ -0,0 +1,66 @@
72+{% extends "base.html" %}
73+{% load i18n %}
74+{% load humanize %}
75+{% load pagination_tags %}
76+
77+
78+{% block title %}
79+| {% trans "Test Results" %}
80+| {{ test_result }}
81+{% endblock %}
82+
83+
84+{% block breadcrumbs %}
85+<li><a href="{% url dashboard_app.views.bundle_stream_list %}">{% trans "Bundle Streams" %}</a></li>
86+<li><a href="{{ test_result.test_run.bundle.bundle_stream.get_absolute_url }}">{{ test_result.test_run.bundle.bundle_stream }}</a></li>
87+<li><a href="{{ test_result.test_run.get_absolute_url }}">{{ test_result.test_run }}</a></li>
88+<li><a href="{{ test_result.get_absolute_url }}">{{ test_result }}</a></li>
89+{% endblock %}
90+
91+
92+{% block sidebar %}
93+<dl>
94+ <dt>{% trans "Test Name" %}</dt>
95+ <dd>{{ test_result.test_run.test }}</dd>
96+ <dt>{% trans "Test case" %}</dt>
97+ <dd>{{ test_result.test_case }}</dd>
98+ <dt>{% trans "Log file name" %}</dt>
99+ <dd>{{ test_result.filename }}</dd>
100+ <dt>{% trans "Line no." %}</dt>
101+ <dd>{{ test_result.lineno }}</dd>
102+ <dt>{% trans "Test executed at" %}</dt>
103+ <dd>
104+ {{ test_result.timestamp|naturalday }}
105+ {{ test_result.timestamp|time }}
106+ </dd>
107+ <dt>{% trans "Time taken to execute test" %}</dt>
108+ <dd>{{ test_result.duration }}</dd>
109+</dl>
110+{% endblock %}
111+
112+
113+{% block content %}
114+{% if test_result.attributes.values %}
115+<h2>{% trans "Test log [" %}{{ test_result.filename }}{% trans "] Details:" %}</h2>
116+<p>{{ test_result.message }}</p>
117+ <table class="data">
118+ <tr><th colspan="4">{% trans "Test Result attribute information" %}</th></tr>
119+ <tr>
120+ <th>{% trans "Id" %}</th>
121+ <th>{% trans "Content Type Id" %}</th>
122+ <th>{% trans "Attribute Name" %}</th>
123+ <th>{% trans "Attribute Value" %}</th>
124+ </tr>
125+ {% for item in test_result.attributes.values %}
126+ <tr>
127+ <td width="1%">{{ item.id }}</td>
128+ <td width="1%">{{ item.content_type_id }}</td>
129+ <td width="1%">{{ item.name }}</td>
130+ <td width="1%">{{ item.value }}</td>
131+ </tr>
132+ {% endfor %}
133+ </table>
134+{% else %}
135+ {%trans "There are no attributes listed for " %}{{ test_result }}
136+{% endif %}
137+{% endblock %}
138
139=== modified file 'dashboard_server/templates/dashboard_app/test_run_detail.html'
140--- dashboard_server/templates/dashboard_app/test_run_detail.html 2010-12-21 16:11:43 +0000
141+++ dashboard_server/templates/dashboard_app/test_run_detail.html 2010-12-23 19:53:10 +0000
142@@ -59,9 +59,10 @@
143 <td width="1%">{{ page_obj.start_index|add:forloop.counter0 }}</td>
144 <td>{{ test_result.test_case }}</td>
145 <td>
146- <img src="{{ MEDIA_URL }}assets/images/icon-{{ test_result.result_code }}.png"
147- alt="{{ test_result.get_result_display }}" width="16" height="16" />
148- {{ test_result.get_result_display }}
149+ <a href ="{{test_result.get_absolute_url}}">
150+ <img src="{{ MEDIA_URL }}assets/images/icon-{{ test_result.result_code }}.png"
151+ alt="{{ test_result.get_result_display }}" width="16" height="16" border="0"/></a>
152+ <a href ="{{test_result.get_absolute_url}}">{{ test_result.get_result_display }}</a>
153 </td>
154 {% if test_result.measurement %}
155 <td>{{ test_result.measurement|default_if_none:"" }} {{ test_result.units }}</td>
156
157=== added file 'example_bundles/test_result_detail.json'
158--- example_bundles/test_result_detail.json 1970-01-01 00:00:00 +0000
159+++ example_bundles/test_result_detail.json 2010-12-23 19:53:10 +0000
160@@ -0,0 +1,80 @@
161+{
162+ "test_runs": [
163+ {
164+ "test_results": [
165+ {
166+ "test_case_id": "helix-0",
167+ "result": "pass",
168+ "message": "Test result Message scrubbed from the log file",
169+ "timestamp": "2010-09-17T16:34:21Z",
170+ "log_filename": "testoutput.log",
171+ "log_lineno": 1,
172+ "duration" : "1d 1s 1us",
173+ "attributes": {
174+ "attr1": "value1",
175+ "attr2": "value2"
176+ }
177+ },
178+ {
179+ "test_case_id": "helix-1",
180+ "result": "fail",
181+ "message": "Test result Message scrubbed from the log file",
182+ "timestamp": "2010-09-18T16:34:21Z",
183+ "log_filename": "testoutput.log",
184+ "log_lineno": 2,
185+ "duration" : "1d 1s 1us",
186+ "attributes": {
187+ "attr1": "value1",
188+ "attr2": "value2"
189+ }
190+ },
191+ {
192+ "test_case_id": "helix-2",
193+ "result": "skip",
194+ "message": "Test result Message scrubbed from the log file",
195+ "timestamp": "2010-09-19T16:34:21Z",
196+ "log_filename": "testoutput.log",
197+ "log_lineno": 3,
198+ "duration" : "1d 1s 1us",
199+ "attributes": {
200+ "attr1": "value1",
201+ "attr2": "value2"
202+ }
203+ },
204+ {
205+ "test_case_id": "helix-3",
206+ "result": "unknown",
207+ "message": "Test result Message scrubbed from the log file",
208+ "timestamp": "2010-09-20T16:34:21Z",
209+ "log_filename": "testoutput.log",
210+ "log_lineno": 4,
211+ "duration" : "1d 1s 1us",
212+ "attributes": {
213+ "attr1": "value1",
214+ "attr2": "value2"
215+ }
216+ },
217+ {
218+ "test_case_id": "helix-4",
219+ "result": "unknown",
220+ "measurement": 512.0,
221+ "units": "bits/s",
222+ "message": "Test result Message scrubbed from the log file",
223+ "timestamp": "2010-09-21T16:34:21Z",
224+ "log_filename": "testoutput.log",
225+ "log_lineno": 5,
226+ "duration" : "1d 1s 1us",
227+ "attributes": {
228+ "attr1": "value1",
229+ "attr2": "value2"
230+ }
231+ }
232+ ],
233+ "analyzer_assigned_date": "2010-10-15T22:05:45Z",
234+ "time_check_performed": false,
235+ "analyzer_assigned_uuid": "00000000-0000-0000-0000-000000000005",
236+ "test_id": "double-helix"
237+ }
238+ ],
239+ "format": "Dashboard Bundle Format 1.0"
240+}

Subscribers

People subscribed via source and target branches