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

Side by Side Diff: appengine/findit/handlers/test/config_test.py

Issue 2438673004: [Findit] Post analysis results of flakes to bug filed by chromium-try-flakes. (Closed)
Patch Set: Add a config flag to enable/disable updating monorail bug. Created 4 years, 1 month 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
OLDNEW
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
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
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 }))
OLDNEW
« no previous file with comments | « appengine/findit/handlers/flake/test/check_flake_test.py ('k') | appengine/findit/model/flake/master_flake_analysis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698