Index: appengine/findit/waterfall/test/waterfall_config_test.py |
diff --git a/appengine/findit/waterfall/test/waterfall_config_test.py b/appengine/findit/waterfall/test/waterfall_config_test.py |
index 1e4d53e18318fad640967670151737992d6cc11f..e3098243fdfbb98d6eded98a04d91fc2638f55a6 100644 |
--- a/appengine/findit/waterfall/test/waterfall_config_test.py |
+++ b/appengine/findit/waterfall/test/waterfall_config_test.py |
@@ -2,67 +2,11 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-from testing_utils import testing |
- |
-from model.wf_config import FinditConfig |
from waterfall import waterfall_config |
+from waterfall.test import wf_testcase |
-class MastersTest(testing.AppengineTestCase): |
- |
- def setUp(self): |
- super(MastersTest, self).setUp() |
- self.mock_current_user(user_email='test@chromium.org', is_admin=True) |
- |
- config_data = { |
- 'steps_for_masters_rules': { |
- 'supported_masters': { |
- 'master1': { |
- # supported_steps override global. |
- 'supported_steps': ['step6'], |
- 'unsupported_steps': ['step1', 'step2', 'step3'], |
- }, |
- 'master2': { |
- # Only supports step4 and step5 regardless of global. |
- 'supported_steps': ['step4', 'step5'], |
- 'check_global': False |
- }, |
- 'master3': { |
- # Supports everything not blacklisted in global. |
- }, |
- }, |
- 'global': { |
- # Blacklists all listed steps for all masters unless overridden. |
- 'unsupported_steps': ['step6', 'step7'], |
- } |
- }, |
- 'builders_to_trybots': { |
- 'master1': { |
- 'builder1': { |
- 'mastername': 'tryserver1', |
- 'buildername': 'trybot1', |
- 'strict_regex': True, |
- } |
- } |
- }, |
- 'try_job_settings': { |
- 'server_query_interval_seconds': 60, |
- 'job_timeout_hours': 5, |
- 'allowed_response_error_times': 1 |
- }, |
- 'swarming_settings': { |
- 'server_host': 'chromium-swarm.appspot.com', |
- 'default_request_priority': 150, |
- 'request_expiration_hours': 20, |
- 'server_query_interval_seconds': 60, |
- 'task_timeout_hours': 23, |
- 'isolated_server': 'https://isolateserver.appspot.com', |
- 'isolated_storage_url': 'isolateserver.storage.googleapis.com', |
- 'iterations_to_rerun': 10 |
- } |
- } |
- |
- FinditConfig.Get().Update(**config_data) |
+class MastersTest(wf_testcase.WaterfallTestCase): |
def testConvertOldMastersFormatToNew(self): |
self.assertEqual( |
@@ -79,7 +23,6 @@ class MastersTest(testing.AppengineTestCase): |
{ |
'master1': ['1', '2'], |
'master2': {} |
- |
})) |
def testGetStepsForMastersRulesWithSettingsProvided(self): |
@@ -95,7 +38,8 @@ class MastersTest(testing.AppengineTestCase): |
def testStepIsSupportedForMaster(self): |
self.assertFalse( |
- waterfall_config.StepIsSupportedForMaster('step1', 'master1')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step1', |
+ 'master1')) |
self.assertTrue( |
waterfall_config.StepIsSupportedForMaster('step4', 'master1')) |
self.assertTrue( |
@@ -111,15 +55,20 @@ class MastersTest(testing.AppengineTestCase): |
self.assertTrue( |
waterfall_config.StepIsSupportedForMaster('step5', 'master2')) |
self.assertFalse( |
- waterfall_config.StepIsSupportedForMaster('step7', 'master2')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step7', |
+ 'master2')) |
self.assertTrue( |
- waterfall_config.StepIsSupportedForMaster('step6', 'master1')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step6', |
+ 'master1')) |
self.assertFalse( |
- waterfall_config.StepIsSupportedForMaster('step6', 'master2')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step6', |
+ 'master2')) |
self.assertFalse( |
- waterfall_config.StepIsSupportedForMaster('step6', 'master3')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step6', |
+ 'master3')) |
self.assertFalse( |
- waterfall_config.StepIsSupportedForMaster('step7', 'master3')) |
+ waterfall_config.StepIsSupportedForMaster('unsupported_step7', |
+ 'master3')) |
def testGetTrybotForWaterfallBuilder(self): |
self.assertEqual( |
@@ -134,7 +83,7 @@ class MastersTest(testing.AppengineTestCase): |
{ |
'server_query_interval_seconds': 60, |
'job_timeout_hours': 5, |
- 'allowed_response_error_times': 1 |
+ 'allowed_response_error_times': 5 |
}, |
waterfall_config.GetTryJobSettings()) |