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 builderL atestRevisions"> | 7 <polymer-element name="ct-failure-analyzer" attributes="failures builderLatestRe visions"> |
ojan
2014/07/21 00:44:56
The changes in this file are the only substantive
| |
8 <script> | 8 <script> |
9 // FIXME: Don't use a polymer component for this. Instead use a Failures mod el | |
10 // object that knows how to do the XHR and process the data appropriately. | |
9 Polymer({ | 11 Polymer({ |
12 builderLatestRevisions: {}, | |
10 failures: {}, | 13 failures: {}, |
11 pendingUnexpectedFailures: [], | |
12 builderLatestRevisions: {}, | |
13 | 14 |
14 update: function() { | 15 update: function() { |
15 this._updateFailingBuilders(); | 16 net.json('http://auto-sheriff.appspot.com/data').then(function(data) { |
16 this._updateUnexpectedFailures(); | 17 // FIXME: Don't special-case the blink master. |
17 }, | 18 this.builderLatestRevisions = data.latest_revisions['chromium.webkit'] ; |
18 | 19 this.failures.builders = {}; |
19 _updateFailingBuilders: function() { | 20 this.failures.unexpected = []; |
20 builders.buildersFailingNonLayoutTests().then((function(builders) { | 21 data.range_groups.forEach(function(group) { |
21 this.failures.builders = builders; | 22 this._processFailuresForGroup(group, data.alerts); |
22 }).bind(this)); | 23 }.bind(this)); |
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)); | 24 }.bind(this)); |
32 }, | 25 }, |
33 | 26 |
34 _updateUnexpectedFailures: function() { | 27 _processFailuresForGroup: function(group, failures) { |
35 this.pendingUnexpectedFailures = []; | 28 var failuresByReason = {}; |
36 var numberOfTestsAnalyzed = 0; | 29 var failingBuildersWithoutReasons = {}; |
37 this.status = 'Updating ...'; | 30 |
38 Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder() ]).then(function() { | 31 group.failure_keys.forEach(function(failure_key) { |
39 this.status = 'Analyzing test failures ...'; | 32 var failure = failures.find(function(item) { return item.key == failur e_key; }); |
40 model.analyzeUnexpectedFailures(function(failureAnalysis, total) { | 33 if (failure.ignored_by.length) |
41 this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyz ed + '/' + total + ' tests analyzed.'; | 34 return; |
42 this.pendingUnexpectedFailures.push(failureAnalysis); | 35 |
43 }.bind(this)).then(function() { | 36 // FIXME: Make sheriff-o-matic work for all waterfalls. |
44 this.status = 'Done'; | 37 if (!failure.master_url.endsWith('chromium.webkit')) |
45 this.failures.unexpected = this.pendingUnexpectedFailures; | 38 return; |
46 this._updateBuilderLatestRevisions(); | 39 |
47 }.bind(this)); | 40 // FIXME: Have sheriff-o-matic show non-webkit_tests failures by reaso n. |
41 if (!failure.reason || failure.step_name != 'webkit_tests') { | |
42 var builder = failure.builder_name; | |
43 if (!failingBuildersWithoutReasons[builder]) | |
44 failingBuildersWithoutReasons[builder] = {}; | |
45 failingBuildersWithoutReasons[builder][failure.step_name] = 1; | |
46 return; | |
47 } | |
48 | |
49 // FIXME: Store the actual failure type in a different field instead o f smashing it into the reason. | |
50 var parts = failure.reason.split(':'); | |
abarth-chromium
2014/07/21 06:44:17
Seems like we should do this work in Python.
ojan
2014/07/21 22:46:13
Yeah. Eric didn't want to do that for some reason.
| |
51 var reason = parts[0]; | |
52 var failureType = parts[1]; | |
53 | |
54 if (!failuresByReason[reason]) | |
55 failuresByReason[reason] = {} | |
56 failuresByReason[reason][failure.builder_name] = { | |
57 actual: failureType, | |
58 }; | |
59 }.bind(this)); | |
60 | |
61 var groupedFailures = []; | |
62 var oldestFailingRevision = Number(group.merged_first_failing.blink); | |
63 var newestPassingRevision = group.merged_last_passing ? Number(group.mer ged_last_passing.blink) : undefined; | |
64 | |
65 Object.keys(failuresByReason, function(reason, resultNodesByBuilder) { | |
66 groupedFailures.push({ | |
67 testName: reason, | |
68 resultNodesByBuilder: resultNodesByBuilder, | |
69 oldestFailingRevision: oldestFailingRevision, | |
70 newestPassingRevision: newestPassingRevision, | |
71 }); | |
72 }); | |
73 | |
74 if (groupedFailures.length) | |
75 this.failures.unexpected.push(groupedFailures); | |
76 | |
77 // FIXME: Show these in the failure stream with regression ranges like | |
78 // any other kind of failure. | |
79 Object.keys(failingBuildersWithoutReasons, function(builder, steps) { | |
80 this.failures.builders[builder] = Object.keys(steps); | |
48 }.bind(this)); | 81 }.bind(this)); |
49 }, | 82 }, |
50 }); | 83 }); |
51 </script> | 84 </script> |
52 </polymer-element> | 85 </polymer-element> |
OLD | NEW |