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

Unified Diff: appengine/findit/handlers/test/config_test.py

Issue 2104113002: [Findit] Add settings for actions after culprits or suspects are identified. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@group_same_failures
Patch Set: Address chan's comments. Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/handlers/config.py ('k') | appengine/findit/model/wf_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/test/config_test.py
diff --git a/appengine/findit/handlers/test/config_test.py b/appengine/findit/handlers/test/config_test.py
index 16c2043cab34b61daa3f7bc52fd14c315ad46ce9..55ac171b146cd5e9a9b22e009e6fcf27b48b9c75 100644
--- a/appengine/findit/handlers/test/config_test.py
+++ b/appengine/findit/handlers/test/config_test.py
@@ -75,6 +75,11 @@ _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS = {
'use_chrome_build_extract': True
}
+_MOCK_ACTION_SETTINGS = {
+ 'cr_notification_build_threshold': 2,
+ 'cr_notification_latency_limit_minutes': 1000,
+}
+
_MOCK_VERSION_NUMBER = 12
@@ -89,7 +94,8 @@ class ConfigTest(testing.AppengineTestCase):
'builders_to_trybots': _MOCK_BUILDERS_TO_TRYBOTS,
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
- 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS
+ 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
}
self.mock_current_user(user_email='test@chromium.org', is_admin=True)
@@ -106,6 +112,7 @@ class ConfigTest(testing.AppengineTestCase):
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
'version': 1,
'latest_version': 1,
'updated_by': 'test',
@@ -122,7 +129,8 @@ class ConfigTest(testing.AppengineTestCase):
'builders_to_trybots': _MOCK_BUILDERS_TO_TRYBOTS,
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
- 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS
+ 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
}
wf_config.FinditConfig.Get().Update(users.GetCurrentUser(), True,
**config_data)
@@ -137,6 +145,7 @@ class ConfigTest(testing.AppengineTestCase):
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
'version': 1,
'latest_version': 1,
'updated_by': 'test',
@@ -643,7 +652,8 @@ class ConfigTest(testing.AppengineTestCase):
'builders_to_trybots': _MOCK_BUILDERS_TO_TRYBOTS,
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
- 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS
+ 'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
})
}
@@ -671,6 +681,7 @@ class ConfigTest(testing.AppengineTestCase):
'try_job_settings': _MOCK_TRY_JOB_SETTINGS,
'swarming_settings': _MOCK_SWARMING_SETTINGS,
'download_build_data_settings': _MOCK_DOWNLOAD_BUILD_DATA_SETTINGS,
+ 'action_settings': _MOCK_ACTION_SETTINGS,
'version': 1,
'latest_version': 1,
'updated_by': 'test',
@@ -678,3 +689,11 @@ class ConfigTest(testing.AppengineTestCase):
}
self.assertEquals(expected_response, response.json_body)
+
+ def testValidateActionSettings(self):
+ self.assertFalse(config._ValidateActionSettings({}))
+ self.assertTrue(config._ValidateActionSettings(
+ {
+ 'cr_notification_build_threshold': 2,
+ 'cr_notification_latency_limit_minutes': 1000,
+ }))
« no previous file with comments | « appengine/findit/handlers/config.py ('k') | appengine/findit/model/wf_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698