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 CTSheriffFailureGroupData(failures, commitList) { | 10 function CTSheriffFailureGroupData(failures, commitList) { |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 CTSheriffFailureGroupData.prototype.dataToExamine = function() { | 22 CTSheriffFailureGroupData.prototype.dataToExamine = function() { |
23 return this.failures; | 23 return this.failures; |
24 }; | 24 }; |
25 | 25 |
26 CTSheriffFailureGroupData.prototype.failureKeys = function() { | 26 CTSheriffFailureGroupData.prototype.failureKeys = function() { |
27 return this.failures.map(function(failure) { | 27 return this.failures.map(function(failure) { |
28 return failure.keys(); | 28 return failure.keys(); |
29 }).flatten(); | 29 }).flatten(); |
30 }; | 30 }; |
31 | |
32 CTSheriffFailureGroupData.prototype.failedOnce = function() { | |
esprehn
2014/09/10 03:59:13
This is much better.
| |
33 var totalFailures = 0; | |
34 for (var i = 0; i < this.failures.length; i++) { | |
35 var resultNodes = this.failures[i].resultNodesByBuilder; | |
36 for (var r in resultNodes) { | |
37 totalFailures += resultNodes[r].failingBuildCount; | |
38 if (totalFailures > 1) | |
39 return false; | |
40 } | |
41 } | |
42 return totalFailures == 1; | |
43 } | |
31 </script> | 44 </script> |
OLD | NEW |