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

Proposed by Deepti B. Kalakeri
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) Needs Fixing
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.
Revision history for this message
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
Revision history for this message
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

Adding the missing template changes for test result display view

122. By Deepti B. Kalakeri

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

123. By Deepti B. Kalakeri

Improving the test run detail view

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dashboard_app/models.py'
--- dashboard_app/models.py 2010-12-20 11:52:16 +0000
+++ dashboard_app/models.py 2010-12-23 19:53:10 +0000
@@ -735,3 +735,8 @@
735 (duration.days * 24 * 60 * 60 * 10 ** 6))735 (duration.days * 24 * 60 * 60 * 10 ** 6))
736736
737 duration = property(_get_duration, _set_duration)737 duration = property(_get_duration, _set_duration)
738
739 @models.permalink
740 def get_absolute_url(self):
741 return ("dashboard_app.views.test_result_detail",
742 [self.pk])
738743
=== modified file 'dashboard_app/urls.py'
--- dashboard_app/urls.py 2010-12-13 13:08:20 +0000
+++ dashboard_app/urls.py 2010-12-23 19:53:10 +0000
@@ -27,11 +27,14 @@
27 restricted_view,27 restricted_view,
28 dashboard_xml_rpc_handler,28 dashboard_xml_rpc_handler,
29 test_run_detail,29 test_run_detail,
30 test_result_detail,
30 )31 )
3132
32urlpatterns = patterns('',33urlpatterns = patterns('',
33 url(r'^streams/$', bundle_stream_list,34 url(r'^streams/$', bundle_stream_list,
34 name='dashboard_app.bundle_stream_list'),35 name='dashboard_app.bundle_stream_list'),
36 url(r'^test-results/(?P<pk>[0-9]+)/$',
37 test_result_detail, name='dashboard_app.views.test_result_detail'),
35 url(r'^test-runs/(?P<analyzer_assigned_uuid>[a-zA-Z0-9-]+)/$',38 url(r'^test-runs/(?P<analyzer_assigned_uuid>[a-zA-Z0-9-]+)/$',
36 test_run_detail, name='dashboard_app.views.test_run_detail'),39 test_run_detail, name='dashboard_app.views.test_run_detail'),
37 url(r'^streams(?P<pathname>/[a-zA-Z0-9/-]+/)$', bundle_stream_detail,40 url(r'^streams(?P<pathname>/[a-zA-Z0-9/-]+/)$', bundle_stream_detail,
3841
=== modified file 'dashboard_app/views.py'
--- dashboard_app/views.py 2010-12-21 16:02:22 +0000
+++ dashboard_app/views.py 2010-12-23 19:53:10 +0000
@@ -31,7 +31,7 @@
31from django.template import RequestContext31from django.template import RequestContext
3232
33from dashboard_app.dispatcher import DjangoXMLRPCDispatcher33from dashboard_app.dispatcher import DjangoXMLRPCDispatcher
34from dashboard_app.models import (Bundle, BundleStream, TestRun)34from dashboard_app.models import (Bundle, BundleStream, TestRun, TestResult)
35from dashboard_app.xmlrpc import DashboardAPI35from dashboard_app.xmlrpc import DashboardAPI
3636
3737
@@ -155,6 +155,21 @@
155 resp.status_code = 403155 resp.status_code = 403
156 return resp156 return resp
157157
158def test_result_detail(request, pk):
159 test_result = get_object_or_404(TestResult, pk=pk)
160 if test_result.test_run.bundle.bundle_stream.can_access(request.user):
161 return list_detail.object_detail(
162 request,
163 slug_field = 'id',
164 slug = pk,
165 queryset = TestResult.objects.all(),
166 template_name = 'dashboard_app/test_result_detail.html',
167 template_object_name = 'test_result',
168 )
169 else:
170 resp = render_to_response("403.html", RequestContext(request))
171 resp.status_code = 403
172 return resp
158173
159def auth_test(request):174def auth_test(request):
160 response = HttpResponse(mimetype="text/plain")175 response = HttpResponse(mimetype="text/plain")
161176
=== added file 'dashboard_server/templates/dashboard_app/test_result_detail.html'
--- dashboard_server/templates/dashboard_app/test_result_detail.html 1970-01-01 00:00:00 +0000
+++ dashboard_server/templates/dashboard_app/test_result_detail.html 2010-12-23 19:53:10 +0000
@@ -0,0 +1,66 @@
1{% extends "base.html" %}
2{% load i18n %}
3{% load humanize %}
4{% load pagination_tags %}
5
6
7{% block title %}
8| {% trans "Test Results" %}
9| {{ test_result }}
10{% endblock %}
11
12
13{% block breadcrumbs %}
14<li><a href="{% url dashboard_app.views.bundle_stream_list %}">{% trans "Bundle Streams" %}</a></li>
15<li><a href="{{ test_result.test_run.bundle.bundle_stream.get_absolute_url }}">{{ test_result.test_run.bundle.bundle_stream }}</a></li>
16<li><a href="{{ test_result.test_run.get_absolute_url }}">{{ test_result.test_run }}</a></li>
17<li><a href="{{ test_result.get_absolute_url }}">{{ test_result }}</a></li>
18{% endblock %}
19
20
21{% block sidebar %}
22<dl>
23 <dt>{% trans "Test Name" %}</dt>
24 <dd>{{ test_result.test_run.test }}</dd>
25 <dt>{% trans "Test case" %}</dt>
26 <dd>{{ test_result.test_case }}</dd>
27 <dt>{% trans "Log file name" %}</dt>
28 <dd>{{ test_result.filename }}</dd>
29 <dt>{% trans "Line no." %}</dt>
30 <dd>{{ test_result.lineno }}</dd>
31 <dt>{% trans "Test executed at" %}</dt>
32 <dd>
33 {{ test_result.timestamp|naturalday }}
34 {{ test_result.timestamp|time }}
35 </dd>
36 <dt>{% trans "Time taken to execute test" %}</dt>
37 <dd>{{ test_result.duration }}</dd>
38</dl>
39{% endblock %}
40
41
42{% block content %}
43{% if test_result.attributes.values %}
44<h2>{% trans "Test log [" %}{{ test_result.filename }}{% trans "] Details:" %}</h2>
45<p>{{ test_result.message }}</p>
46 <table class="data">
47 <tr><th colspan="4">{% trans "Test Result attribute information" %}</th></tr>
48 <tr>
49 <th>{% trans "Id" %}</th>
50 <th>{% trans "Content Type Id" %}</th>
51 <th>{% trans "Attribute Name" %}</th>
52 <th>{% trans "Attribute Value" %}</th>
53 </tr>
54 {% for item in test_result.attributes.values %}
55 <tr>
56 <td width="1%">{{ item.id }}</td>
57 <td width="1%">{{ item.content_type_id }}</td>
58 <td width="1%">{{ item.name }}</td>
59 <td width="1%">{{ item.value }}</td>
60 </tr>
61 {% endfor %}
62 </table>
63{% else %}
64 {%trans "There are no attributes listed for " %}{{ test_result }}
65{% endif %}
66{% endblock %}
067
=== modified file 'dashboard_server/templates/dashboard_app/test_run_detail.html'
--- dashboard_server/templates/dashboard_app/test_run_detail.html 2010-12-21 16:11:43 +0000
+++ dashboard_server/templates/dashboard_app/test_run_detail.html 2010-12-23 19:53:10 +0000
@@ -59,9 +59,10 @@
59 <td width="1%">{{ page_obj.start_index|add:forloop.counter0 }}</td>59 <td width="1%">{{ page_obj.start_index|add:forloop.counter0 }}</td>
60 <td>{{ test_result.test_case }}</td>60 <td>{{ test_result.test_case }}</td>
61 <td>61 <td>
62 <img src="{{ MEDIA_URL }}assets/images/icon-{{ test_result.result_code }}.png" 62 <a href ="{{test_result.get_absolute_url}}">
63 alt="{{ test_result.get_result_display }}" width="16" height="16" />63 <img src="{{ MEDIA_URL }}assets/images/icon-{{ test_result.result_code }}.png"
64 {{ test_result.get_result_display }}64 alt="{{ test_result.get_result_display }}" width="16" height="16" border="0"/></a>
65 <a href ="{{test_result.get_absolute_url}}">{{ test_result.get_result_display }}</a>
65 </td>66 </td>
66 {% if test_result.measurement %}67 {% if test_result.measurement %}
67 <td>{{ test_result.measurement|default_if_none:"" }} {{ test_result.units }}</td>68 <td>{{ test_result.measurement|default_if_none:"" }} {{ test_result.units }}</td>
6869
=== added file 'example_bundles/test_result_detail.json'
--- example_bundles/test_result_detail.json 1970-01-01 00:00:00 +0000
+++ example_bundles/test_result_detail.json 2010-12-23 19:53:10 +0000
@@ -0,0 +1,80 @@
1{
2 "test_runs": [
3 {
4 "test_results": [
5 {
6 "test_case_id": "helix-0",
7 "result": "pass",
8 "message": "Test result Message scrubbed from the log file",
9 "timestamp": "2010-09-17T16:34:21Z",
10 "log_filename": "testoutput.log",
11 "log_lineno": 1,
12 "duration" : "1d 1s 1us",
13 "attributes": {
14 "attr1": "value1",
15 "attr2": "value2"
16 }
17 },
18 {
19 "test_case_id": "helix-1",
20 "result": "fail",
21 "message": "Test result Message scrubbed from the log file",
22 "timestamp": "2010-09-18T16:34:21Z",
23 "log_filename": "testoutput.log",
24 "log_lineno": 2,
25 "duration" : "1d 1s 1us",
26 "attributes": {
27 "attr1": "value1",
28 "attr2": "value2"
29 }
30 },
31 {
32 "test_case_id": "helix-2",
33 "result": "skip",
34 "message": "Test result Message scrubbed from the log file",
35 "timestamp": "2010-09-19T16:34:21Z",
36 "log_filename": "testoutput.log",
37 "log_lineno": 3,
38 "duration" : "1d 1s 1us",
39 "attributes": {
40 "attr1": "value1",
41 "attr2": "value2"
42 }
43 },
44 {
45 "test_case_id": "helix-3",
46 "result": "unknown",
47 "message": "Test result Message scrubbed from the log file",
48 "timestamp": "2010-09-20T16:34:21Z",
49 "log_filename": "testoutput.log",
50 "log_lineno": 4,
51 "duration" : "1d 1s 1us",
52 "attributes": {
53 "attr1": "value1",
54 "attr2": "value2"
55 }
56 },
57 {
58 "test_case_id": "helix-4",
59 "result": "unknown",
60 "measurement": 512.0,
61 "units": "bits/s",
62 "message": "Test result Message scrubbed from the log file",
63 "timestamp": "2010-09-21T16:34:21Z",
64 "log_filename": "testoutput.log",
65 "log_lineno": 5,
66 "duration" : "1d 1s 1us",
67 "attributes": {
68 "attr1": "value1",
69 "attr2": "value2"
70 }
71 }
72 ],
73 "analyzer_assigned_date": "2010-10-15T22:05:45Z",
74 "time_check_performed": false,
75 "analyzer_assigned_uuid": "00000000-0000-0000-0000-000000000005",
76 "test_id": "double-helix"
77 }
78 ],
79 "format": "Dashboard Bundle Format 1.0"
80}

Subscribers

People subscribed via source and target branches