Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Side by Side Diff: Tools/GardeningServer/model/test/ct-failures-tests.html

Issue 661463004: Include all hung bots alerts in Trooper tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comment and fix var names. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Tools/GardeningServer/model/ct-failures.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <link rel="import" href="../ct-failures.html"> 7 <link rel="import" href="../ct-failures.html">
8 8
9 <link rel="import" href="../../lib/network-simulator.html"> 9 <link rel="import" href="../../lib/network-simulator.html">
10 <link rel="import" href="../ct-commit-list.html"> 10 <link rel="import" href="../ct-commit-list.html">
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 }); 406 });
407 }); 407 });
408 }); 408 });
409 }); 409 });
410 }); 410 });
411 411
412 describe('processTrooperFailures', function() { 412 describe('processTrooperFailures', function() {
413 it('should filter out updates that are not alerts', function() { 413 it('should filter out updates that are not alerts', function() {
414 var analyzer = new CTFailures(new CTCommitList(undefined, [])); 414 var analyzer = new CTFailures(new CTCommitList(undefined, []));
415 analyzer.failures = {}; 415 analyzer.failures = {};
416 analyzer._processTrooperFailures( 416 analyzer._processTrooperFailures({},
417 {'key_1': {'tree_1': {should_alert: true, should_appear: true}, 417 {'key_1': {'tree_1': {should_alert: true, should_appear: true},
418 'tree_2': {should_alert: false, should_appear: false}}, 418 'tree_2': {should_alert: false, should_appear: false}},
419 'key_2': {'tree_3': {should_alert: false, should_appear: false}, 419 'key_2': {'tree_3': {should_alert: false, should_appear: false},
420 'tree_4': {should_alert: true, should_appear: true}}}); 420 'tree_4': {should_alert: true, should_appear: true}}});
421 analyzer.failures['trooper'].forEach(function(failure) { 421 analyzer.failures['trooper'].forEach(function(failure) {
422 assert(failure.data.data.should_appear); 422 assert(failure.data.data.should_appear);
423 }); 423 });
424 assert(analyzer.failures['trooper'].length == 2); 424 assert(analyzer.failures['trooper'].length == 2);
425 }); 425 });
426 }); 426 });
427 427
428 describe('processTrooperFailures', function() {
429 it('should list all failures with category builder and master', function() {
430 var emptyCommit = new CTCommitList(undefined, []);
431 var emptyGroupData = new CTStepFailureGroupData([], emptyCommit);
432 var group1 = new CTFailureGroup('', emptyGroupData, 'builder');
433 var group2 = new CTFailureGroup('', emptyGroupData, 'failedOnce');
434 var group3 = new CTFailureGroup('', emptyGroupData, 'master');
435
436 var analyzer = new CTFailures(new CTCommitList(undefined, []));
437 analyzer.failures = {};
438 analyzer._processTrooperFailures(
439 {'tree_1': [group1], 'tree_2': [group2, group3]}, {});
440 analyzer.failures['trooper'].forEach(function(failure) {
441 assert(failure.category == 'builder' || failure.category == 'master');
442 });
443 assert(analyzer.failures['trooper'].length == 2);
444 });
445 });
446
428 describe('processFailuresForRangeGroup', function() { 447 describe('processFailuresForRangeGroup', function() {
429 it('should use tree name from json', function() { 448 it('should use tree name from json', function() {
430 var analyzer = new CTFailures(null); 449 var analyzer = new CTFailures(null);
431 450
432 var annotations = Promise.resolve({ 451 var annotations = Promise.resolve({
433 'test-key': 'test-annotation', 452 'test-key': 'test-annotation',
434 }) 453 })
435 var range_groups = { 454 var range_groups = {
436 'failure_keys': ['test-key'], 455 'failure_keys': ['test-key'],
437 'likely_revisions': [] 456 'likely_revisions': []
(...skipping 15 matching lines...) Expand all
453 analyzer._processFailuresForRangeGroup(newFailures, range_groups, alertsBy Key, annotations) 472 analyzer._processFailuresForRangeGroup(newFailures, range_groups, alertsBy Key, annotations)
454 assert.ok('test-tree' in newFailures) 473 assert.ok('test-tree' in newFailures)
455 assert.notOk('chromium' in newFailures) 474 assert.notOk('chromium' in newFailures)
456 }); 475 });
457 }); 476 });
458 477
459 }); 478 });
460 479
461 })() 480 })()
462 </script> 481 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/model/ct-failures.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698