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 <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 Loading... | |
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 emptycl = new CTCommitList(undefined, []); | |
431 var emptygd = new CTStepFailureGroupData([], emptycl); | |
ojan
2014/10/16 21:20:39
We've been avoiding acronyms except for standard o
navabi
2014/10/16 23:56:05
Done.
| |
432 var group1 = new CTFailureGroup('', emptygd, 'builder'); | |
433 var group2 = new CTFailureGroup('', emptygd, 'failedOnce'); | |
434 var group3 = new CTFailureGroup('', emptygd, '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 Loading... | |
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> |
OLD | NEW |