| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import datetime | 5 import datetime |
| 6 import json | 6 import json |
| 7 import re | 7 import re |
| 8 import webapp2 | 8 import webapp2 |
| 9 import webtest | 9 import webtest |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 _MOCK_SWARMING_SETTINGS = { | 61 _MOCK_SWARMING_SETTINGS = { |
| 62 'server_host': 'chromium-swarm.appspot.com', | 62 'server_host': 'chromium-swarm.appspot.com', |
| 63 'default_request_priority': 150, | 63 'default_request_priority': 150, |
| 64 'request_expiration_hours': 20, | 64 'request_expiration_hours': 20, |
| 65 'server_query_interval_seconds': 60, | 65 'server_query_interval_seconds': 60, |
| 66 'task_timeout_hours': 23, | 66 'task_timeout_hours': 23, |
| 67 'isolated_server': 'https://isolateserver.appspot.com', | 67 'isolated_server': 'https://isolateserver.appspot.com', |
| 68 'isolated_storage_url': 'isolateserver.storage.googleapis.com', | 68 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 69 'iterations_to_rerun': 10, | 69 'iterations_to_rerun': 10, |
| 70 'get_swarming_task_id_timeout_seconds': 5 * 60, # 5 minutes. | 70 'get_swarming_task_id_timeout_seconds': 5 * 60, # 5 minutes. |
| 71 'get_swarming_task_id_wait_seconds': 10 | 71 'get_swarming_task_id_wait_seconds': 10, |
| 72 'server_retry_timeout_hours': 2, |
| 73 'maximum_server_contact_retry_interval_seconds': 5 * 60, # 5 minutes. |
| 74 'should_retry_server': False, # No retry for unit testing. |
| 72 } | 75 } |
| 73 | 76 |
| 74 | 77 |
| 75 _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS = { | 78 _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS = { |
| 76 'download_interval_seconds': 10, | 79 'download_interval_seconds': 10, |
| 77 'memcache_master_download_expiration_seconds': 3600, | 80 'memcache_master_download_expiration_seconds': 3600, |
| 78 'use_chrome_build_extract': True | 81 'use_chrome_build_extract': True |
| 79 } | 82 } |
| 80 | 83 |
| 81 _MOCK_ACTION_SETTINGS = { | 84 _MOCK_ACTION_SETTINGS = { |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 'default_request_priority': 150, | 622 'default_request_priority': 150, |
| 620 'request_expiration_hours': 20, | 623 'request_expiration_hours': 20, |
| 621 'server_query_interval_seconds': 60, | 624 'server_query_interval_seconds': 60, |
| 622 'task_timeout_hours': 23, | 625 'task_timeout_hours': 23, |
| 623 'isolated_server': 'https://isolateserver.appspot.com', | 626 'isolated_server': 'https://isolateserver.appspot.com', |
| 624 'isolated_storage_url': 'isolateserver.storage.googleapis.com', | 627 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 625 'iterations_to_rerun': 1, | 628 'iterations_to_rerun': 1, |
| 626 'get_swarming_task_id_timeout_seconds': 300, | 629 'get_swarming_task_id_timeout_seconds': 300, |
| 627 'get_swarming_task_id_wait_seconds': [] # Should be an int. | 630 'get_swarming_task_id_wait_seconds': [] # Should be an int. |
| 628 })) | 631 })) |
| 632 self.assertFalse(config._ValidateSwarmingSettings({ |
| 633 'server_host': 'chromium-swarm.appspot.com', |
| 634 'default_request_priority': 150, |
| 635 'request_expiration_hours': 20, |
| 636 'server_query_interval_seconds': 60, |
| 637 'task_timeout_hours': 23, |
| 638 'isolated_server': 'https://isolateserver.appspot.com', |
| 639 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 640 'iterations_to_rerun': 1, |
| 641 'get_swarming_task_id_timeout_seconds': 300, |
| 642 'get_swarming_task_id_wait_secondds': 10, |
| 643 'server_retry_timeout_hours': {} # Should be an int. |
| 644 })) |
| 645 self.assertFalse(config._ValidateSwarmingSettings({ |
| 646 'server_host': 'chromium-swarm.appspot.com', |
| 647 'default_request_priority': 150, |
| 648 'request_expiration_hours': 20, |
| 649 'server_query_interval_seconds': 60, |
| 650 'task_timeout_hours': 23, |
| 651 'isolated_server': 'https://isolateserver.appspot.com', |
| 652 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 653 'iterations_to_rerun': 1, |
| 654 'get_swarming_task_id_timeout_seconds': 300, |
| 655 'get_swarming_task_id_wait_secondds': 10, |
| 656 'server_retry_timeout_hours': 1, |
| 657 'maximum_server_contact_retry_interval_seconds': '' # Should be an int. |
| 658 })) |
| 659 self.assertFalse(config._ValidateSwarmingSettings({ |
| 660 'server_host': 'chromium-swarm.appspot.com', |
| 661 'default_request_priority': 150, |
| 662 'request_expiration_hours': 20, |
| 663 'server_query_interval_seconds': 60, |
| 664 'task_timeout_hours': 23, |
| 665 'isolated_server': 'https://isolateserver.appspot.com', |
| 666 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 667 'iterations_to_rerun': 1, |
| 668 'get_swarming_task_id_timeout_seconds': 300, |
| 669 'get_swarming_task_id_wait_secondds': 10, |
| 670 'server_retry_timeout_hours': 1, |
| 671 'maximum_server_contact_retry_interval_seconds': 2, |
| 672 'should_retry_server': 3 # Should be a bool. |
| 673 })) |
| 629 self.assertTrue(config._ValidateSwarmingSettings({ | 674 self.assertTrue(config._ValidateSwarmingSettings({ |
| 630 'server_host': 'chromium-swarm.appspot.com', | 675 'server_host': 'chromium-swarm.appspot.com', |
| 631 'default_request_priority': 150, | 676 'default_request_priority': 150, |
| 632 'request_expiration_hours': 20, | 677 'request_expiration_hours': 20, |
| 633 'server_query_interval_seconds': 60, | 678 'server_query_interval_seconds': 60, |
| 634 'task_timeout_hours': 23, | 679 'task_timeout_hours': 23, |
| 635 'isolated_server': 'https://isolateserver.appspot.com', | 680 'isolated_server': 'https://isolateserver.appspot.com', |
| 636 'isolated_storage_url': 'isolateserver.storage.googleapis.com', | 681 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
| 637 'iterations_to_rerun': 10, | 682 'iterations_to_rerun': 10, |
| 638 'get_swarming_task_id_timeout_seconds': 300, | 683 'get_swarming_task_id_timeout_seconds': 300, |
| 639 'get_swarming_task_id_wait_seconds': 10 | 684 'get_swarming_task_id_wait_seconds': 10, |
| 685 'server_retry_timeout_hours': 1, |
| 686 'maximum_server_contact_retry_interval_seconds': 1, |
| 687 'should_retry_server': False, |
| 640 })) | 688 })) |
| 641 | 689 |
| 642 def testValidateDownloadBuildDataSettings(self): | 690 def testValidateDownloadBuildDataSettings(self): |
| 643 self.assertFalse(config._ValidateDownloadBuildDataSettings({})) | 691 self.assertFalse(config._ValidateDownloadBuildDataSettings({})) |
| 644 self.assertFalse(config._ValidateDownloadBuildDataSettings({ | 692 self.assertFalse(config._ValidateDownloadBuildDataSettings({ |
| 645 'download_interval_seconds': {}, # Should be an int. | 693 'download_interval_seconds': {}, # Should be an int. |
| 646 'memcache_master_download_expiration_seconds': 10, | 694 'memcache_master_download_expiration_seconds': 10, |
| 647 'use_chrome_build_extract': True | 695 'use_chrome_build_extract': True |
| 648 })) | 696 })) |
| 649 self.assertFalse(config._ValidateDownloadBuildDataSettings({ | 697 self.assertFalse(config._ValidateDownloadBuildDataSettings({ |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 { | 898 { |
| 851 'lower_flake_threshold': 0.02, | 899 'lower_flake_threshold': 0.02, |
| 852 'upper_flake_threshold': 0.98, | 900 'upper_flake_threshold': 0.98, |
| 853 'max_flake_in_a_row': 4, | 901 'max_flake_in_a_row': 4, |
| 854 'max_stable_in_a_row': 4, | 902 'max_stable_in_a_row': 4, |
| 855 'iterations_to_rerun': 100, | 903 'iterations_to_rerun': 100, |
| 856 'max_build_numbers_to_look_back': 1000, | 904 'max_build_numbers_to_look_back': 1000, |
| 857 'use_nearby_neighbor': True, | 905 'use_nearby_neighbor': True, |
| 858 'update_monorail_bug': True, | 906 'update_monorail_bug': True, |
| 859 })) | 907 })) |
| OLD | NEW |