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 <script> | 7 <script> |
8 function CTStepFailure(step, reason, resultsByBuilder) { | 8 function CTStepFailure(step, reason, resultsByBuilder) { |
9 this.key = step + '::' + reason; | 9 this.key = step + '::' |
| 10 |
| 11 // The key needs to be unique, so disambiguate null reason |
| 12 // failures by their builders, but don't do regular failures |
| 13 // by builders because we want failures with reasons to update |
| 14 // the existing failure group instead of causing the group to |
| 15 // get recreated since throwing it away loses in app state. |
| 16 if (reason) |
| 17 this.key += reason; |
| 18 else |
| 19 this.key += Object.keys(resultsByBuilder).join('::'); |
| 20 |
10 this.step = step; | 21 this.step = step; |
11 // FIXME: Rename this to reason. | 22 // FIXME: Rename this to reason. |
12 this.testName = reason; | 23 this.testName = reason; |
13 // Maps a builder_name (e.g. "Mac ASan Tests (1)") | 24 // Maps a builder_name (e.g. "Mac ASan Tests (1)") |
14 // to the details of the failure on that builder. | 25 // to the details of the failure on that builder. |
15 this.resultNodesByBuilder = resultsByBuilder; | 26 this.resultNodesByBuilder = resultsByBuilder; |
16 } | 27 } |
17 | 28 |
18 CTStepFailure.prototype.isTreeCloser = function() { | 29 CTStepFailure.prototype.isTreeCloser = function() { |
19 for (var builder in this.resultNodesByBuilder) { | 30 for (var builder in this.resultNodesByBuilder) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 76 |
66 // FIXME: This should just be provided as part of the alerts feed. | 77 // FIXME: This should just be provided as part of the alerts feed. |
67 CTStepFailure.createKey = function(alert) { | 78 CTStepFailure.createKey = function(alert) { |
68 function normalize(str) { | 79 function normalize(str) { |
69 str = str == null ? '' : String(str); | 80 str = str == null ? '' : String(str); |
70 return str.replace(/:/g, '_'); | 81 return str.replace(/:/g, '_'); |
71 } | 82 } |
72 return [alert.master_url, alert.builder_name, alert.failing_build, alert.step_
name, alert.reason].map(normalize).join('::'); | 83 return [alert.master_url, alert.builder_name, alert.failing_build, alert.step_
name, alert.reason].map(normalize).join('::'); |
73 } | 84 } |
74 </script> | 85 </script> |
OLD | NEW |