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

Unified Diff: scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py

Issue 1928783004: Extend chromium_tests trigger to work across masters. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Expectations Created 4 years, 8 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
Index: scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py
diff --git a/scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py b/scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py
index 527adacf5bee91e3641b5fba5f6fcadbc927f6b7..20441ffd7534c60b75d612ddb0e0934fe8e07e44 100644
--- a/scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py
+++ b/scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db.py
@@ -120,7 +120,7 @@ class BotConfig(object):
bot_config = bot_db.get_bot_config(
bot_id['mastername'], bot_id['buildername'])
- for _, test_bot in bot_db.bot_configs_matching_parent_buildername(
+ for _, _, test_bot in bot_db.bot_configs_matching_parent_buildername(
bot_id['mastername'], bot_id['buildername']):
tests_including_triggered.extend(test_bot.get('tests', []))
@@ -182,14 +182,20 @@ class BotConfigAndTestDB(object):
return self._db[mastername]['master_dict'].get('settings', {})
def bot_configs_matching_parent_buildername(
- self, mastername, parent_buildername):
+ self, parent_mastername, parent_buildername):
"""A generator of all the (buildername, bot_config) tuples whose
parent_buildername is the passed one on the given master.
"""
- for buildername, bot_config in self._db[mastername]['master_dict'].get(
- 'builders', {}).iteritems():
- if bot_config.get('parent_buildername') == parent_buildername:
- yield buildername, bot_config
+ for mastername, master_config in self._db.iteritems():
+ master_dict = self._db[parent_mastername]['master_dict']
+ for buildername, bot_config in master_dict.get(
+ 'builders', {}).iteritems():
+ master_matches = (
+ bot_config.get('parent_master', mastername) == parent_mastername)
Paweł Hajdan Jr. 2016/04/29 18:49:26 Let's be consistent and use 'parent_mastername' (i
dtu 2016/04/30 02:51:07 Done.
+ builder_matches = (
+ bot_config.get('parent_buildername') == parent_buildername)
+ if master_matches and builder_matches:
+ yield mastername, buildername, bot_config
def get_test_spec(self, mastername, buildername):
return self._db[mastername]['test_spec'].get(buildername, {})

Powered by Google App Engine
This is Rietveld 408576698