| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 'cr_notification_build_threshold': 2, | 82 'cr_notification_build_threshold': 2, |
| 83 'cr_notification_latency_limit_minutes': 1000, | 83 'cr_notification_latency_limit_minutes': 1000, |
| 84 } | 84 } |
| 85 | 85 |
| 86 _MOCK_CHECK_FLAKE_SETTINGS = { | 86 _MOCK_CHECK_FLAKE_SETTINGS = { |
| 87 'lower_flake_threshold': 0.02, | 87 'lower_flake_threshold': 0.02, |
| 88 'upper_flake_threshold': 0.98, | 88 'upper_flake_threshold': 0.98, |
| 89 'max_flake_in_a_row': 4, | 89 'max_flake_in_a_row': 4, |
| 90 'max_stable_in_a_row': 4, | 90 'max_stable_in_a_row': 4, |
| 91 'iterations_to_rerun': 100, | 91 'iterations_to_rerun': 100, |
| 92 'max_build_numbers_to_look_back': 1000 | 92 'max_build_numbers_to_look_back': 1000, |
| 93 'update_monorail_bug': True, |
| 93 } | 94 } |
| 94 | 95 |
| 95 _MOCK_VERSION_NUMBER = 12 | 96 _MOCK_VERSION_NUMBER = 12 |
| 96 | 97 |
| 97 | 98 |
| 98 class ConfigTest(testing.AppengineTestCase): | 99 class ConfigTest(testing.AppengineTestCase): |
| 99 app_module = webapp2.WSGIApplication([ | 100 app_module = webapp2.WSGIApplication([ |
| 100 ('/config', config.Configuration), | 101 ('/config', config.Configuration), |
| 101 ], debug=True) | 102 ], debug=True) |
| 102 | 103 |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 })) | 812 })) |
| 812 self.assertFalse(config._ValidateCheckFlakeSettings( | 813 self.assertFalse(config._ValidateCheckFlakeSettings( |
| 813 { | 814 { |
| 814 'lower_flake_threshold': 0.02, | 815 'lower_flake_threshold': 0.02, |
| 815 'upper_flake_threshold': 0.98, | 816 'upper_flake_threshold': 0.98, |
| 816 'max_flake_in_a_row': 4, | 817 'max_flake_in_a_row': 4, |
| 817 'max_stable_in_a_row': 4, | 818 'max_stable_in_a_row': 4, |
| 818 'iterations_to_rerun': 4, | 819 'iterations_to_rerun': 4, |
| 819 'max_build_numbers_to_look_back': 'a' # Should be an int. | 820 'max_build_numbers_to_look_back': 'a' # Should be an int. |
| 820 })) | 821 })) |
| 822 self.assertFalse(config._ValidateCheckFlakeSettings( |
| 823 { |
| 824 'lower_flake_threshold': 0.02, |
| 825 'upper_flake_threshold': 0.98, |
| 826 'max_flake_in_a_row': 4, |
| 827 'max_stable_in_a_row': 4, |
| 828 'iterations_to_rerun': 100, |
| 829 'max_build_numbers_to_look_back': 1000, |
| 830 'update_monorail_bug': 'True', # Should be a bool. |
| 831 })) |
| 821 self.assertTrue(config._ValidateCheckFlakeSettings( | 832 self.assertTrue(config._ValidateCheckFlakeSettings( |
| 822 { | 833 { |
| 823 'lower_flake_threshold': 0.02, | 834 'lower_flake_threshold': 0.02, |
| 824 'upper_flake_threshold': 0.98, | 835 'upper_flake_threshold': 0.98, |
| 825 'max_flake_in_a_row': 4, | 836 'max_flake_in_a_row': 4, |
| 826 'max_stable_in_a_row': 4, | 837 'max_stable_in_a_row': 4, |
| 827 'iterations_to_rerun': 100, | 838 'iterations_to_rerun': 100, |
| 828 'max_build_numbers_to_look_back': 1000 | 839 'max_build_numbers_to_look_back': 1000, |
| 840 'update_monorail_bug': True, |
| 829 })) | 841 })) |
| OLD | NEW |