| 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(key, data) { | 10 function CTFailureGroup(key, data) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bug: bug, | 37 bug: bug, |
| 38 }); | 38 }); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 CTFailureGroup.prototype.clearBug = function(bug) { | 41 CTFailureGroup.prototype.clearBug = function(bug) { |
| 42 return this._annotate({ | 42 return this._annotate({ |
| 43 bug: undefined, | 43 bug: undefined, |
| 44 }); | 44 }); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 CTFailureGroup.prototype._failedOnce = function() { |
| 48 var totalFailures = 0; |
| 49 for (var i = 0; i < this.data.dataToExamine().length; i++) { |
| 50 var resultNodes = this.data.dataToExamine()[i].resultNodesByBuilder; |
| 51 Object.keys(resultNodes, function(r) { |
| 52 totalFailures += resultNodes[r].failingBuildCount; |
| 53 if (totalFailures > 1) |
| 54 return false; |
| 55 }.bind(this)); |
| 56 } |
| 57 return totalFailures == 1; |
| 58 } |
| 59 |
| 47 CTFailureGroup.prototype._computeProperties = function() { | 60 CTFailureGroup.prototype._computeProperties = function() { |
| 48 this.isSnoozed = Date.now() < this._annotation.snoozeTime; | 61 this.isSnoozed = Date.now() < this._annotation.snoozeTime; |
| 49 if (this.isSnoozed) { | 62 if (this.isSnoozed) { |
| 50 this.category = 'snoozed'; | 63 this.category = 'snoozed'; |
| 51 } else { | 64 } else { |
| 65 if (this._failedOnce()) { |
| 66 this.category = 'failedOnce'; |
| 67 } else { |
| 68 this.category = 'default'; |
| 69 } |
| 52 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test
failure, Flaky tests | 70 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test
failure, Flaky tests |
| 53 this.category = 'default'; | |
| 54 } | 71 } |
| 55 | 72 |
| 56 this.bug = this._annotation.bug; | 73 this.bug = this._annotation.bug; |
| 57 // FIXME: Bug labels would be simpler to implement as a filter in the UI. | 74 // FIXME: Bug labels would be simpler to implement as a filter in the UI. |
| 58 if (this.bug != null) | 75 if (this.bug != null) |
| 59 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0]; | 76 this.bugLabel = 'Bug ' + /([0-9]{3,})/.exec(this.bug)[0]; |
| 60 else | 77 else |
| 61 this.bugLabel = undefined; | 78 this.bugLabel = undefined; |
| 62 }; | 79 }; |
| 63 | 80 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 }.bind(this)); | 126 }.bind(this)); |
| 110 }; | 127 }; |
| 111 | 128 |
| 112 CTFailureGroup.fetchAnnotations = function() { | 129 CTFailureGroup.fetchAnnotations = function() { |
| 113 // FIXME: Fetch annotations from frontend. | 130 // FIXME: Fetch annotations from frontend. |
| 114 var stored = localStorage.CTFailureGroupAnnotations; | 131 var stored = localStorage.CTFailureGroupAnnotations; |
| 115 var annotations = stored ? JSON.parse(stored) : {}; | 132 var annotations = stored ? JSON.parse(stored) : {}; |
| 116 return Promise.resolve(annotations); | 133 return Promise.resolve(annotations); |
| 117 }; | 134 }; |
| 118 </script> | 135 </script> |
| OLD | NEW |