diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 277: merge for bug 877859: add measurement information to the json output

Message ID 20111025111618.3797.84301.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Yongqin Liu Oct. 25, 2011, 11:16 a.m. UTC
Merge authors:
  Yongqin Liu (liuyq0307)
  Yongqin Liu (liuyq0307)
Related merge proposals:
  https://code.launchpad.net/~liuyq0307/lava-dashboard/add-measurement-for-json/+merge/80305
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 277 [merge]
committer: Yongqin Liu <yongqin.liu@linaro.org>
branch nick: lava-dashboard
timestamp: Tue 2011-10-25 19:13:03 +0800
message:
  merge for bug 877859: add measurement information to the json output
modified:
  dashboard_app/views.py


--
lp:lava-dashboard
https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk

You are subscribed to branch lp:lava-dashboard.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'dashboard_app/views.py'
--- dashboard_app/views.py	2011-10-06 12:03:00 +0000
+++ dashboard_app/views.py	2011-10-25 11:13:03 +0000
@@ -187,10 +187,21 @@ 
     bundle = bundle_stream.bundles.get(content_sha1=content_sha1)
     test_runs = []
     for test_run in bundle.test_runs.all():
+        results = test_run.get_summary_results()
+
+        measurements = [{'item': str(item.test_case),
+                           'measurement': str(item.measurement),
+                           'units': str(item.units)
+                          }
+                for item in test_run.test_results.filter(
+                            measurement__isnull=False).
+                        order_by('test_case__test_case_id')]
+        results['measurements'] = measurements
+
         test_runs.append({
             'name': test_run.test.test_id,
             'url': request.build_absolute_uri(test_run.get_absolute_url()),
-            'results': test_run.get_summary_results()
+            'results': results
             })
     json_text = json.dumps({
         'test_runs':test_runs,