Commit c12abd14 authored by John Budorick's avatar John Budorick Committed by Commit Bot

Read luci-milo-dev.cfg for //testing/buildbot presubmits.

Bug: 874109
Change-Id: Id969b6a28a93e2aa595efcabf32666cae95fa46c
Reviewed-on: https://chromium-review.googlesource.com/1174964Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582997}
parent a59dbcd6
...@@ -715,14 +715,22 @@ class BBJSONGenerator(object): ...@@ -715,14 +715,22 @@ class BBJSONGenerator(object):
def get_valid_bot_names(self): def get_valid_bot_names(self):
# Extract bot names from infra/config/global/luci-milo.cfg. # Extract bot names from infra/config/global/luci-milo.cfg.
bot_names = set() bot_names = set()
for l in self.read_file(os.path.join( infra_config_dir = os.path.abspath(
'..', '..', 'infra', 'config', 'global', 'luci-milo.cfg')).splitlines(): os.path.join(os.path.dirname(__file__),
if (not 'name: "buildbucket/luci.chromium.' in l and '..', '..', 'infra', 'config', 'global'))
not 'name: "buildbot/chromium.' in l): milo_configs = [
continue os.path.join(infra_config_dir, 'luci-milo.cfg'),
# l looks like `name: "buildbucket/luci.chromium.try/win_chromium_dbg_ng"` os.path.join(infra_config_dir, 'luci-milo-dev.cfg'),
# Extract win_chromium_dbg_ng part. ]
bot_names.add(l[l.rindex('/') + 1:l.rindex('"')]) for c in milo_configs:
for l in self.read_file(c).splitlines():
if (not 'name: "buildbucket/luci.chromium.' in l and
not 'name: "buildbot/chromium.' in l):
continue
# l looks like
# `name: "buildbucket/luci.chromium.try/win_chromium_dbg_ng"`
# Extract win_chromium_dbg_ng part.
bot_names.add(l[l.rindex('/') + 1:l.rindex('"')])
return bot_names return bot_names
def get_bots_that_do_not_actually_exist(self): def get_bots_that_do_not_actually_exist(self):
......
...@@ -15,12 +15,17 @@ import generate_buildbot_json ...@@ -15,12 +15,17 @@ import generate_buildbot_json
class FakeBBGen(generate_buildbot_json.BBJSONGenerator): class FakeBBGen(generate_buildbot_json.BBJSONGenerator):
def __init__(self, waterfalls, test_suites, exceptions, luci_milo_cfg): def __init__(self, waterfalls, test_suites, exceptions, luci_milo_cfg):
super(FakeBBGen, self).__init__() super(FakeBBGen, self).__init__()
infra_config_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..',
'infra', 'config', 'global'))
luci_milo_cfg_path = os.path.join(infra_config_dir, 'luci-milo.cfg')
luci_milo_dev_cfg_path = os.path.join(infra_config_dir, 'luci-milo-dev.cfg')
self.files = { self.files = {
'waterfalls.pyl': waterfalls, 'waterfalls.pyl': waterfalls,
'test_suites.pyl': test_suites, 'test_suites.pyl': test_suites,
'test_suite_exceptions.pyl': exceptions, 'test_suite_exceptions.pyl': exceptions,
os.path.join( '..', '..', 'infra', 'config', 'global', 'luci-milo.cfg'): luci_milo_cfg_path: luci_milo_cfg,
luci_milo_cfg, luci_milo_dev_cfg_path: '',
} }
def read_file(self, relative_path): def read_file(self, relative_path):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment