Commit 4a7e249b authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Fix bot name gathering for builds during a period of time.

During that period of time, COMPUTERNAME in full environment printout is
listed as SWARM761-C4 instead of the real bot.

This CL collects bot name from multiple places and selects one as "BUILD***".

BUG=867155
TEST=manual
R=kbr@chromium.org
NOTRY=true

Change-Id: I5ffda633449ae869885643b3927dead9f8b58758
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1562894Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649736}
parent b3d44503
......@@ -118,6 +118,7 @@ def ProcessStepStdout(stdout_url, entry):
lines = data.splitlines()
pattern = re.compile('^\[(\d+)/(\d+)\]$')
results = None
bot_candidates = []
for line in lines:
if results is not None:
my_results = results
......@@ -139,16 +140,26 @@ def ProcessStepStdout(stdout_url, entry):
elif line.startswith('Chrome Env: '):
chrome_env = ast.literal_eval(line[len('Chrome Env: '):])
if 'COMPUTERNAME' in chrome_env:
entry['bot'] = chrome_env['COMPUTERNAME']
bot_candidates.append(chrome_env['COMPUTERNAME'])
elif line.startswith('INFO:root:Chrome Env: '):
chrome_env = ast.literal_eval(line[len('INFO:root:Chrome Env: '):])
if 'COMPUTERNAME' in chrome_env:
entry['bot'] = chrome_env['COMPUTERNAME']
bot_candidates.append(chrome_env['COMPUTERNAME'])
elif line.startswith('Env: '):
chrome_env = ast.literal_eval(line[len('Env: '):])
if 'COMPUTERNAME' in chrome_env:
bot_candidates.append(chrome_env['COMPUTERNAME'])
elif line.startswith(' COMPUTERNAME: '):
entry['bot'] = line.strip()[len('COMPUTERNAME: '):]
bot_candidates.append(line.strip()[len('COMPUTERNAME: '):])
elif line.startswith('Results: '):
assert results is None
results = ast.literal_eval(line[len('Results: '):])
for name in bot_candidates:
if name.startswith('BUILD'):
entry['bot'] = name
break
else:
logging.warn('[BUILD %d] Fail to locate the bot name' % number)
def CollectBuildData(build, data_entry):
......
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