OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="../lib/net.html"> | 7 <link rel="import" href="../lib/net.html"> |
8 <link rel="import" href="../lib/update-util.html"> | 8 <link rel="import" href="../lib/update-util.html"> |
9 <link rel="import" href="ct-builder-failure.html"> | 9 <link rel="import" href="ct-builder-failure.html"> |
10 <link rel="import" href="ct-step-failure.html"> | 10 <link rel="import" href="ct-step-failure.html"> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 this._processBuilderFailure(newFailures, alert); | 127 this._processBuilderFailure(newFailures, alert); |
128 }.bind(this)); | 128 }.bind(this)); |
129 | 129 |
130 // Sort failure groups so that newer failures are shown at the top | 130 // Sort failure groups so that newer failures are shown at the top |
131 // of the UI. | 131 // of the UI. |
132 Object.keys(newFailures, function (tree, failuresByTree) { | 132 Object.keys(newFailures, function (tree, failuresByTree) { |
133 failuresByTree.sort(this._failureByTreeListComparator.bind(this, tree)); | 133 failuresByTree.sort(this._failureByTreeListComparator.bind(this, tree)); |
134 }.bind(this)); | 134 }.bind(this)); |
135 | 135 |
136 this.failures = updateUtil.updateLeft(this.failures, newFailures); | 136 this.failures = updateUtil.updateLeft(this.failures, newFailures); |
137 this._processTrooperFailures(trooper_data); | 137 this._processTrooperFailures(newFailures, trooper_data); |
138 }.bind(this)); | 138 }.bind(this)); |
139 }; | 139 }; |
140 | 140 |
141 CTFailures.prototype._failureComparator = function(a, b) { | 141 CTFailures.prototype._failureComparator = function(a, b) { |
142 if (a.step > b.step) | 142 if (a.step > b.step) |
143 return 1; | 143 return 1; |
144 if (a.step < b.step) | 144 if (a.step < b.step) |
145 return -1 | 145 return -1 |
146 if (a.testName > b.testName) | 146 if (a.testName > b.testName) |
147 return 1; | 147 return 1; |
148 if (a.testName < b.testName) | 148 if (a.testName < b.testName) |
149 return -1 | 149 return -1 |
150 return 0; | 150 return 0; |
151 }; | 151 }; |
152 | 152 |
153 CTFailures.prototype._processTrooperFailures = function(data) { | 153 CTFailures.prototype._processTrooperFailures = function(all_failures, |
| 154 trooper_data) { |
154 var trooper_failures = []; | 155 var trooper_failures = []; |
155 Object.keys(data, function(failureType, failuresByTree) { | 156 Object.keys(trooper_data, function(failureType, failuresByTree) { |
156 Object.keys(failuresByTree, function(tree, failure) { | 157 Object.keys(failuresByTree, function(tree, failure) { |
157 if (failure.should_alert) { | 158 if (failure.should_alert) { |
158 trooper_failures.push(new CTFailureGroup('trooper', | 159 trooper_failures.push(new CTFailureGroup('trooper', |
159 new CTTrooperFailureGroupData(failure.details, failure.url, failure,
failureType, tree))); | 160 new CTTrooperFailureGroupData(failure.details, failure.url, failure, |
| 161 failureType, tree))); |
160 } | 162 } |
161 }); | 163 }); |
162 }); | 164 }); |
| 165 |
| 166 Object.keys(all_failures, function(tree, failuresByTree) { |
| 167 failuresByTree.forEach(function(failure) { |
| 168 if (failure.category == 'builder' || failure.category == 'master') { |
| 169 trooper_failures.push(failure); |
| 170 } |
| 171 }); |
| 172 }); |
163 this.failures['trooper'] = trooper_failures; | 173 this.failures['trooper'] = trooper_failures; |
164 }; | 174 }; |
165 | 175 |
166 CTFailures.prototype._groupFailuresByTreeAndReason = function(failures, annotati
ons) { | 176 CTFailures.prototype._groupFailuresByTreeAndReason = function(failures, annotati
ons) { |
167 var failuresByTree = {}; | 177 var failuresByTree = {}; |
168 failures.forEach(function(failure) { | 178 failures.forEach(function(failure) { |
169 // Establish the key to uniquely identify a failure by reason. | 179 // Establish the key to uniquely identify a failure by reason. |
170 var failureKey = CTStepFailure.createKey(failure); | 180 var failureKey = CTStepFailure.createKey(failure); |
171 | 181 |
172 var reasonKey = JSON.stringify({ | 182 var reasonKey = JSON.stringify({ |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 data = new CTMasterFailureGroupData(failure, alert.master_url); | 248 data = new CTMasterFailureGroupData(failure, alert.master_url); |
239 } | 249 } |
240 if (!newFailures[alert.tree]) | 250 if (!newFailures[alert.tree]) |
241 newFailures[alert.tree] = []; | 251 newFailures[alert.tree] = []; |
242 newFailures[alert.tree].push(new CTFailureGroup(alert.tree, data, category)); | 252 newFailures[alert.tree].push(new CTFailureGroup(alert.tree, data, category)); |
243 }; | 253 }; |
244 | 254 |
245 })(); | 255 })(); |
246 | 256 |
247 </script> | 257 </script> |
OLD | NEW |