diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 394: multiple runs in image-reports now shown properly

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

Commit Message

Andy Doan Feb. 8, 2013, 3:38 a.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dashboard/multiple-runs-of-same-build-number/+merge/147278
  proposed by: Michael Hudson-Doyle (mwhudson)
------------------------------------------------------------
revno: 394 [merge]
committer: Andy Doan <andy.doan@linaro.org>
branch nick: lava-dashboard
timestamp: Thu 2013-02-07 21:36:43 -0600
message:
  multiple runs in image-reports now shown properly
modified:
  dashboard_app/views/images.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/images.py'
--- dashboard_app/views/images.py	2012-12-18 00:47:08 +0000
+++ dashboard_app/views/images.py	2013-02-08 02:35:13 +0000
@@ -83,7 +83,7 @@ 
         for test_run in match.test_runs:
             name = test_run.test.test_id
             denorm = test_run.denormalization
-            if denorm.count_pass == denorm.count_all():
+            if denorm.count_fail == 0:
                 cls = 'present pass'
             else:
                     cls = 'present fail'
@@ -93,19 +93,18 @@ 
                 cls=cls,
                 uuid=test_run.analyzer_assigned_uuid,
                 passes=denorm.count_pass,
-                total=denorm.count_all(),
+                total=denorm.count_pass + denorm.count_fail,
                 link=test_run.get_permalink(),
                 bug_ids=bug_ids,
                 )
-            if match.tag not in build_number_to_cols:
-                # This assumes 1 bundle per match...
-                build_number_to_cols[match.tag] = {
+            if (match.tag, test_run.bundle.uploaded_on) not in build_number_to_cols:
+                build_number_to_cols[(match.tag, test_run.bundle.uploaded_on)] = {
                     'test_runs': {},
                     'number': match.tag,
                     'date': test_run.bundle.uploaded_on,
                     'link': test_run.bundle.get_absolute_url(),
                     }
-            build_number_to_cols[match.tag]['test_runs'][name] = test_run_data
+            build_number_to_cols[(match.tag, test_run.bundle.uploaded_on)]['test_runs'][name] = test_run_data
             if name != 'lava':
                 test_run_names.add(name)