Commit a10b2d07 by Jonah Ryan-Davis Committed by Commit Bot

Modify 'bb ls' command for generate_stats for more precision.

We were using 'bb ls ... -A' which combines '-p' and '-steps', but we only parse information from '-p'. Updates the script to only call what it needs. Also works around current issue with '-A'. Bug: angleproject:3429 Change-Id: I10d412885663feefd300eb135dae70b499fedd7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1600334Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent 5cbaa3f8
...@@ -156,12 +156,12 @@ INFO_TAG = '*RESULT' ...@@ -156,12 +156,12 @@ INFO_TAG = '*RESULT'
# Returns a struct with info about the latest successful build given a bot name. Info contains the # Returns a struct with info about the latest successful build given a bot name. Info contains the
# build_name, time, date, angle_revision, and chrome revision. # build_name, time, date, angle_revision, and chrome revision.
# Uses: bb ls '<botname>' -n 1 -status success -A # Uses: bb ls '<botname>' -n 1 -status success -p
def get_latest_success_build_info(bot_name): def get_latest_success_build_info(bot_name):
bb = subprocess.Popen(['bb', 'ls', bot_name, '-n', '1', '-status', 'success', '-A'], bb = subprocess.Popen(['bb', 'ls', bot_name, '-n', '1', '-status', 'success', '-p'],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
LOGGER.debug("Ran [bb ls '" + bot_name + "' -n 1 -status success -A]") LOGGER.debug("Ran [bb ls '" + bot_name + "' -n 1 -status success -p]")
out, err = bb.communicate() out, err = bb.communicate()
if err: if err:
raise ValueError("Unexpected error from bb ls: '" + err + "'") raise ValueError("Unexpected error from bb ls: '" + err + "'")
...@@ -251,7 +251,8 @@ def validate_step_info(step_info, build_name, step_name): ...@@ -251,7 +251,8 @@ def validate_step_info(step_info, build_name, step_name):
computed_total = sum(partial_sum_values) computed_total = sum(partial_sum_values)
if step_info['Total'] != computed_total: if step_info['Total'] != computed_total:
LOGGER.warning('Step info does not sum to total for ' + print_name + ' | Total: ' + LOGGER.warning('Step info does not sum to total for ' + print_name + ' | Total: ' +
str(step_info['Total']) + ' - Computed total: ' + str(computed_total) + '\n') str(step_info['Total']) + ' - Computed total: ' + str(computed_total) +
'\n')
return True return True
...@@ -318,7 +319,8 @@ def get_step_info(build_name, step_name): ...@@ -318,7 +319,8 @@ def get_step_info(build_name, step_name):
else: else:
if key not in append_errors: if key not in append_errors:
append_errors.append(key) append_errors.append(key)
LOGGER.warning("Too many characters in column '" + key + "'. Output capped.") LOGGER.warning("Too many characters in column '" + key +
"'. Output capped.")
if validate_step_info(step_info, build_name, step_name): if validate_step_info(step_info, build_name, step_name):
return step_info return step_info
......
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