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 <polymer-element name="ct-failure-analyzer" attributes="failures status"> | 7 <polymer-element name="ct-failure-analyzer" attributes="failures status builderL
atestRevisions"> |
8 <script> | 8 <script> |
9 Polymer({ | 9 Polymer({ |
10 failures: {}, | 10 failures: {}, |
11 pendingUnexpectedFailures: [], | 11 pendingUnexpectedFailures: [], |
| 12 builderLatestRevisions: {}, |
12 | 13 |
13 update: function() { | 14 update: function() { |
14 this._updateFailingBuilders(); | 15 this._updateFailingBuilders(); |
15 this._updateUnexpectedFailures(); | 16 this._updateUnexpectedFailures(); |
16 }, | 17 }, |
17 | 18 |
18 _updateFailingBuilders: function() { | 19 _updateFailingBuilders: function() { |
19 builders.buildersFailingNonLayoutTests().then((function(builders) { | 20 builders.buildersFailingNonLayoutTests().then((function(builders) { |
20 this.failures.builders = builders; | 21 this.failures.builders = builders; |
21 }).bind(this)); | 22 }).bind(this)); |
22 }, | 23 }, |
23 | 24 |
| 25 _updateBuilderLatestRevisions: function() { |
| 26 this.builderLatestRevisions = {}; |
| 27 Object.keys(config.builders, function(builder) { |
| 28 this.builderLatestRevisions[builder] = { |
| 29 blink: model.state.resultsByBuilder[builder].blink_revision, |
| 30 }; |
| 31 }.bind(this)); |
| 32 }, |
| 33 |
24 _updateUnexpectedFailures: function() { | 34 _updateUnexpectedFailures: function() { |
25 this.pendingUnexpectedFailures = []; | 35 this.pendingUnexpectedFailures = []; |
26 var numberOfTestsAnalyzed = 0; | 36 var numberOfTestsAnalyzed = 0; |
27 this.status = 'Updating ...'; | 37 this.status = 'Updating ...'; |
28 Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()
]).then(function() { | 38 Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()
]).then(function() { |
29 this.status = 'Analyzing test failures ...'; | 39 this.status = 'Analyzing test failures ...'; |
30 model.analyzeUnexpectedFailures(function(failureAnalysis, total) { | 40 model.analyzeUnexpectedFailures(function(failureAnalysis, total) { |
31 this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyz
ed + '/' + total + ' tests analyzed.'; | 41 this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyz
ed + '/' + total + ' tests analyzed.'; |
32 this.pendingUnexpectedFailures.push(failureAnalysis); | 42 this.pendingUnexpectedFailures.push(failureAnalysis); |
33 }.bind(this)).then(function() { | 43 }.bind(this)).then(function() { |
34 this.status = 'Done'; | 44 this.status = 'Done'; |
35 this.failures.unexpected = this.pendingUnexpectedFailures; | 45 this.failures.unexpected = this.pendingUnexpectedFailures; |
| 46 this._updateBuilderLatestRevisions(); |
36 }.bind(this)); | 47 }.bind(this)); |
37 }.bind(this)); | 48 }.bind(this)); |
38 }, | 49 }, |
39 }); | 50 }); |
40 </script> | 51 </script> |
41 </polymer-element> | 52 </polymer-element> |
OLD | NEW |