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="ct-commit-list.html"> | 7 <link rel="import" href="ct-commit-list.html"> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 function CTFailureGroup(failures, commitList) { | 10 function CTFailureGroup(failures, commitList) { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 return this._annotate({ | 40 return this._annotate({ |
| 41 bug: undefined, | 41 bug: undefined, |
| 42 }); | 42 }); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 CTFailureGroup.prototype._computeProperties = function() { | 45 CTFailureGroup.prototype._computeProperties = function() { |
| 46 this.isSnoozed = Date.now() < this._annotation.snoozeTime; | 46 this.isSnoozed = Date.now() < this._annotation.snoozeTime; |
| 47 if (this.isSnoozed) { | 47 if (this.isSnoozed) { |
| 48 this.category = 'snoozed'; | 48 this.category = 'snoozed'; |
| 49 } else { | 49 } else { |
| 50 var totalFailures = 0; | |
| 51 this.failures.map(function(f) { | |
|
ojan
2014/09/05 18:39:44
In the common case, this is going to do a ton of w
| |
| 52 var resultNodes = f.resultNodesByBuilder; | |
| 53 Object.keys(resultNodes, function(r) { | |
| 54 totalFailures += resultNodes[r].failingBuildCount; | |
| 55 }.bind(this)); | |
| 56 }); | |
| 57 if (totalFailures == 1) { | |
| 58 this.category = 'failed_once'; | |
|
ojan
2014/09/05 18:39:44
Nit: We don't have many cases of string values lik
| |
| 59 } else { | |
| 60 this.category = 'default'; | |
| 61 } | |
| 50 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test failure, Flaky tests | 62 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test failure, Flaky tests |
| 51 this.category = 'default'; | |
| 52 } | 63 } |
| 53 | 64 |
| 54 this.bug = this._annotation.bug; | 65 this.bug = this._annotation.bug; |
| 55 // FIXME: Bug labels would be simpler to implement as a filter in the UI. | 66 // FIXME: Bug labels would be simpler to implement as a filter in the UI. |
| 56 if (this.bug != null) | 67 if (this.bug != null) |
| 57 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0]; | 68 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0]; |
| 58 else | 69 else |
| 59 this.bugLabel = undefined; | 70 this.bugLabel = undefined; |
| 60 }; | 71 }; |
| 61 | 72 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 }.bind(this)); | 124 }.bind(this)); |
| 114 }; | 125 }; |
| 115 | 126 |
| 116 CTFailureGroup.fetchAnnotations = function() { | 127 CTFailureGroup.fetchAnnotations = function() { |
| 117 // FIXME: Fetch annotations from frontend. | 128 // FIXME: Fetch annotations from frontend. |
| 118 var stored = localStorage.CTFailureGroupAnnotations; | 129 var stored = localStorage.CTFailureGroupAnnotations; |
| 119 var annotations = stored ? JSON.parse(stored) : {}; | 130 var annotations = stored ? JSON.parse(stored) : {}; |
| 120 return Promise.resolve(annotations); | 131 return Promise.resolve(annotations); |
| 121 }; | 132 }; |
| 122 </script> | 133 </script> |
| OLD | NEW |