Commit b8286cea authored by navabi@google.com's avatar navabi@google.com

Include all hung bots alerts in Trooper tree.

Currently, chromium hung bots and blink hung bots are shown in their
corresponding views. With this change, all hung bots will show up in the Trooper
view. This includes the chromium and blink ones, but also others other trees
(e.g. non-closers).

BUG=412189

Review URL: https://codereview.chromium.org/661463004

git-svn-id: svn://svn.chromium.org/blink/trunk@183850 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 80fc2ec8
...@@ -134,7 +134,7 @@ CTFailures.prototype.update = function() { ...@@ -134,7 +134,7 @@ CTFailures.prototype.update = function() {
}.bind(this)); }.bind(this));
this.failures = updateUtil.updateLeft(this.failures, newFailures); this.failures = updateUtil.updateLeft(this.failures, newFailures);
this._processTrooperFailures(trooper_data); this._processTrooperFailures(newFailures, trooper_data);
}.bind(this)); }.bind(this));
}; };
...@@ -150,13 +150,23 @@ CTFailures.prototype._failureComparator = function(a, b) { ...@@ -150,13 +150,23 @@ CTFailures.prototype._failureComparator = function(a, b) {
return 0; return 0;
}; };
CTFailures.prototype._processTrooperFailures = function(data) { CTFailures.prototype._processTrooperFailures = function(all_failures,
trooper_data) {
var trooper_failures = []; var trooper_failures = [];
Object.keys(data, function(failureType, failuresByTree) { Object.keys(trooper_data, function(failureType, failuresByTree) {
Object.keys(failuresByTree, function(tree, failure) { Object.keys(failuresByTree, function(tree, failure) {
if (failure.should_alert) { if (failure.should_alert) {
trooper_failures.push(new CTFailureGroup('trooper', trooper_failures.push(new CTFailureGroup('trooper',
new CTTrooperFailureGroupData(failure.details, failure.url, failure, failureType, tree))); new CTTrooperFailureGroupData(failure.details, failure.url, failure,
failureType, tree)));
}
});
});
Object.keys(all_failures, function(tree, failuresByTree) {
failuresByTree.forEach(function(failure) {
if (failure.category == 'builder' || failure.category == 'master') {
trooper_failures.push(failure);
} }
}); });
}); });
......
...@@ -466,7 +466,7 @@ describe('ct-failures', function() { ...@@ -466,7 +466,7 @@ describe('ct-failures', function() {
it('should filter out updates that are not alerts', function() { it('should filter out updates that are not alerts', function() {
var analyzer = new CTFailures(new CTCommitList(undefined, [])); var analyzer = new CTFailures(new CTCommitList(undefined, []));
analyzer.failures = {}; analyzer.failures = {};
analyzer._processTrooperFailures( analyzer._processTrooperFailures({},
{'key_1': {'tree_1': {should_alert: true, should_appear: true}, {'key_1': {'tree_1': {should_alert: true, should_appear: true},
'tree_2': {should_alert: false, should_appear: false}}, 'tree_2': {should_alert: false, should_appear: false}},
'key_2': {'tree_3': {should_alert: false, should_appear: false}, 'key_2': {'tree_3': {should_alert: false, should_appear: false},
...@@ -478,6 +478,25 @@ describe('ct-failures', function() { ...@@ -478,6 +478,25 @@ describe('ct-failures', function() {
}); });
}); });
describe('processTrooperFailures', function() {
it('should list all failures with category builder and master', function() {
var emptyCommit = new CTCommitList(undefined, []);
var emptyGroupData = new CTStepFailureGroupData([], emptyCommit);
var group1 = new CTFailureGroup('', emptyGroupData, 'builder');
var group2 = new CTFailureGroup('', emptyGroupData, 'failedOnce');
var group3 = new CTFailureGroup('', emptyGroupData, 'master');
var analyzer = new CTFailures(new CTCommitList(undefined, []));
analyzer.failures = {};
analyzer._processTrooperFailures(
{'tree_1': [group1], 'tree_2': [group2, group3]}, {});
analyzer.failures['trooper'].forEach(function(failure) {
assert(failure.category == 'builder' || failure.category == 'master');
});
assert(analyzer.failures['trooper'].length == 2);
});
});
describe('processFailuresForRangeGroup', function() { describe('processFailuresForRangeGroup', function() {
it('should use tree name from json', function() { it('should use tree name from json', function() {
var analyzer = new CTFailures(null); var analyzer = new CTFailures(null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment