Index: Tools/GardeningServer/model/test/ct-failures-tests.html |
diff --git a/Tools/GardeningServer/model/test/ct-failures-tests.html b/Tools/GardeningServer/model/test/ct-failures-tests.html |
index e68d81257b86cf636d91766b513a1617bda4348c..62140af20b419bd2e0875e2de8ae32635bcafa04 100644 |
--- a/Tools/GardeningServer/model/test/ct-failures-tests.html |
+++ b/Tools/GardeningServer/model/test/ct-failures-tests.html |
@@ -36,10 +36,10 @@ describe('ct-failures', function() { |
var cl2 = new CTCommitList(undefined, ['chromium:2', 'blink:1']); |
var cl3 = new CTCommitList(undefined, ['chromium:2', 'blink:2']); |
var cl4 = new CTCommitList(undefined, []); |
- var group1 = new CTFailureGroup([], cl1); |
- var group2 = new CTFailureGroup([], cl2); |
- var group3 = new CTFailureGroup([], cl3); |
- var group4 = new CTFailureGroup([], cl4); |
+ var group1 = new CTFailureGroup(new CTSheriffFailureGroupData([], cl1)); |
+ var group2 = new CTFailureGroup(new CTSheriffFailureGroupData([], cl2)); |
+ var group3 = new CTFailureGroup(new CTSheriffFailureGroupData([], cl3)); |
+ var group4 = new CTFailureGroup(new CTSheriffFailureGroupData([], cl4)); |
// Sort by last revision first. |
assert(analyzer._failureByTreeListComparator('chromium', group1, group2) > 0); |
@@ -60,6 +60,22 @@ describe('ct-failures', function() { |
assert(analyzer._failureByTreeListComparator('chromium', group4, group1) > 0); |
}); |
}); |
+ |
+ describe('processTrooperFailures', function() { |
+ it('should filter out updates that are not alerts', function() { |
+ var analyzer = new CTFailures(new CTCommitList(undefined, [])); |
+ analyzer._processTrooperFailures( |
+ {'key_1': {'tree_1': {should_alert: true, should_appear: true}, |
+ 'tree_2': {should_alert: false, should_appear: false}}, |
+ 'key_2': {'tree_3': {should_alert: false, should_appear: false}, |
+ 'tree_4': {should_alert: true, should_appear: true}}}); |
+ analyzer.failures['trooper'].forEach(function(failure) { |
+ assert(failure.data.data.should_appear); |
+ }); |
+ assert(analyzer.failures['trooper'].length == 2); |
+ }); |
+ }); |
+ |
}); |
})() |