Chromium Code Reviews| 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 //Add any failures that should be listed in the trooper view. | |
|
ojan
2014/10/16 21:19:22
This comment doesn't really tell you anything othe
navabi
2014/10/16 23:56:05
Removed.
| |
| 167 Object.keys(all_failures, function(tree, failuresByTree) { | |
| 168 failuresByTree.forEach(function(failure) { | |
| 169 if (failure.category == 'builder' || failure.category == 'master') { | |
| 170 trooper_failures.push(failure); | |
| 171 } | |
| 172 }); | |
| 173 }); | |
| 163 this.failures['trooper'] = trooper_failures; | 174 this.failures['trooper'] = trooper_failures; |
| 164 }; | 175 }; |
| 165 | 176 |
| 166 CTFailures.prototype._groupFailuresByTreeAndReason = function(failures, annotati ons) { | 177 CTFailures.prototype._groupFailuresByTreeAndReason = function(failures, annotati ons) { |
| 167 var failuresByTree = {}; | 178 var failuresByTree = {}; |
| 168 failures.forEach(function(failure) { | 179 failures.forEach(function(failure) { |
| 169 // Establish the key to uniquely identify a failure by reason. | 180 // Establish the key to uniquely identify a failure by reason. |
| 170 var failureKey = CTStepFailure.createKey(failure); | 181 var failureKey = CTStepFailure.createKey(failure); |
| 171 | 182 |
| 172 var reasonKey = JSON.stringify({ | 183 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); | 249 data = new CTMasterFailureGroupData(failure, alert.master_url); |
| 239 } | 250 } |
| 240 if (!newFailures[alert.tree]) | 251 if (!newFailures[alert.tree]) |
| 241 newFailures[alert.tree] = []; | 252 newFailures[alert.tree] = []; |
| 242 newFailures[alert.tree].push(new CTFailureGroup(alert.tree, data, category)); | 253 newFailures[alert.tree].push(new CTFailureGroup(alert.tree, data, category)); |
| 243 }; | 254 }; |
| 244 | 255 |
| 245 })(); | 256 })(); |
| 246 | 257 |
| 247 </script> | 258 </script> |
| OLD | NEW |