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

Unified Diff: build/android/buildbot/bb_run_bot.py

Issue 15261003: Add a new script bb_host_steps.py which handles all host side steps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First Full CL Created 7 years, 7 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: build/android/buildbot/bb_run_bot.py
diff --git a/build/android/buildbot/bb_run_bot.py b/build/android/buildbot/bb_run_bot.py
index 77dc7ea98e596cf37a6cf02570afc6ff037b7926..f617c21a3b2c10e7049b7dbf03e0253c5f0d5d5f 100755
--- a/build/android/buildbot/bb_run_bot.py
+++ b/build/android/buildbot/bb_run_bot.py
@@ -13,16 +13,13 @@ import pipes
import subprocess
import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
-from pylib import buildbot_report
-
CHROME_SRC = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', '..'))
GLOBAL_SLAVE_PROPS = {}
BotConfig = collections.namedtuple(
- 'BotConfig', ['bot_id', 'bash_funs', 'test_obj', 'slave_props'])
+ 'BotConfig', ['bot_id', 'host_opts', 'test_obj', 'slave_props'])
TestConfig = collections.namedtuple('Tests', ['tests', 'extra_args'])
Command = collections.namedtuple(
'Command', ['step_name', 'command', 'testing_cmd'])
@@ -46,21 +43,19 @@ def GetCommands(options, bot_config):
'--build-properties=%s' % json.dumps(options.build_properties),
'--slave-properties=%s' % json.dumps(slave_props)]
- commands = []
- def WrapWithBash(command):
- """Wrap a bash command string with envsetup scripts."""
- return ['bash', '-exc', '; '.join([
- '. build/android/buildbot/buildbot_functions.sh',
- 'bb_baseline_setup %s %s' % (
- CHROME_SRC,
- ' '.join(map(pipes.quote, property_args))),
- command])
- ]
-
- if bot_config.bash_funs:
- # bash_funs command does not have a testing mode.
- commands.append(
- Command(None, WrapWithBash('; '.join(bot_config.bash_funs)), None))
+ common_cmd = ['; '.join(['. build/android/buildbot/buildbot_functions.sh',
+ 'bb_baseline_setup %s %s' % (
+ CHROME_SRC,
+ ' '.join(map(pipes.quote, property_args)))])]
+
+ commands = [Command('Preparation', common_cmd, None)]
+
+ host_opts = bot_config.host_opts
+ if host_opts:
+ host_script = 'build/android/buildbot/bb_host_steps.py'
+ host_cmd = [host_script] + host_opts + property_args[0:2]
+ cmd = ' '.join(map(pipes.quote, host_cmd))
+ commands.append(Command('Host steps', [cmd], [cmd]))
test_obj = bot_config.test_obj
if test_obj:
@@ -70,17 +65,17 @@ def GetCommands(options, bot_config):
run_test_cmd.extend(['-f', test])
if test_obj.extra_args:
run_test_cmd.extend(test_obj.extra_args)
- commands.append(Command(
- 'Run tests',
- WrapWithBash(' '.join(map(pipes.quote, run_test_cmd))), run_test_cmd))
+ cmd = ' '.join(map(pipes.quote, run_test_cmd))
+ commands.append(Command('Run tests', [cmd], [cmd]))
return commands
def GetBotStepMap():
- compile_step = ['bb_compile']
- std_build_steps = ['bb_compile', 'bb_zip_build']
- std_test_steps = ['bb_extract_build']
+ compile_opt = ['--compile']
+ std_host_tests = ['--host-tests=check_webview_licenses,findbugs']
+ std_build_opts = ['--compile', '--zipbuild']
+ std_test_opts = ['--extract-build']
std_tests = ['ui', 'unit']
flakiness_server = '--upload-to-flakiness-server'
@@ -90,41 +85,34 @@ def GetBotStepMap():
bot_configs = [
# Main builders
- B('main-builder-dbg',
- ['bb_check_webview_licenses', 'bb_compile', 'bb_run_findbugs',
- 'bb_zip_build'], None, None),
- B('main-builder-rel',
- ['bb_compile', 'bb_zip_build'], None, None),
- B('main-clang-builder', compile_step, None, None),
- B('main-clobber', compile_step, None, None),
- B('main-tests', std_test_steps, T(std_tests, [flakiness_server]),
- None),
+ B('main-builder-dbg', std_build_opts + std_host_tests, None, None),
+ B('main-builder-rel', std_build_opts, None, None),
+ B('main-clang-builder', compile_opt, None, None),
+ B('main-clobber', compile_opt, None, None),
+ B('main-tests', std_test_opts, T(std_tests, [flakiness_server]), None),
# Other waterfalls
- B('asan-builder-tests', compile_step + ['bb_asan_tests_setup'],
+ B('asan-builder-tests', compile_opt + ['--asan-tests-setup'],
T(std_tests, ['--asan']), {'extra_gyp_defines': 'asan=1'}),
- B('chromedriver-fyi-tests-dbg', std_test_steps,
+ B('chromedriver-fyi-tests-dbg', std_test_opts,
T(['chromedriver'], ['--install=ChromiumTestShell']), None),
- B('fyi-builder-dbg',
- ['bb_check_webview_licenses', 'bb_compile', 'bb_compile_experimental',
- 'bb_run_findbugs', 'bb_zip_build'], None, None),
- B('fyi-builder-rel',
- ['bb_compile', 'bb_compile_experimental', 'bb_zip_build'], None, None),
- B('fyi-tests-dbg-ics-gn', ['bb_compile', 'bb_compile_experimental'],
+ B('fyi-builder-dbg', std_build_opts + std_host_tests + ['--experimental'],
+ None, None),
+ B('fyi-builder-rel', std_build_opts + ['--experimental'], None, None),
+ B('fyi-tests-dbg-ics-gn', compile_opt + [ '--experimental'],
T(std_tests, ['--experimental', flakiness_server]), None),
- B('fyi-tests', std_test_steps,
+ B('fyi-tests', std_test_opts,
T(std_tests, ['--experimental', flakiness_server]), None),
- B('fyi-component-builder-tests-dbg', compile_step,
+ B('fyi-component-builder-tests-dbg', compile_opt,
T(std_tests, ['--experimental', flakiness_server]), None),
- B('perf-tests-rel', std_test_steps,
- T([], ['--install=ContentShell']),
+ B('perf-tests-rel', std_test_opts, T([], ['--install=ContentShell']),
None),
- B('webkit-latest-webkit-tests', std_test_steps,
+ B('webkit-latest-webkit-tests', std_test_opts,
T(['webkit_layout', 'webkit']), None),
- B('webkit-latest-contentshell', compile_step, T(['webkit_layout']), None),
+ B('webkit-latest-contentshell', compile_opt, T(['webkit_layout']), None),
# Generic builder config (for substring match).
- B('builder', std_build_steps, None, None),
+ B('builder', std_build_opts, None, None),
]
bot_map = dict((config.bot_id, config) for config in bot_configs)
@@ -202,26 +190,26 @@ def main(argv):
command_objs = GetCommands(options, bot_config)
for command_obj in command_objs:
- print 'Will run:', CommandToString(command_obj.command)
+ print 'Will run "%s" step: %s' % (command_obj.step_name,
+ CommandToString(command_obj.command))
+ commands = []
for command_obj in command_objs:
- if command_obj.step_name:
- buildbot_report.PrintNamedStep(command_obj.step_name)
- command = command_obj.command
- print CommandToString(command)
- sys.stdout.flush()
- env = None
if options.TESTING:
- if not command_obj.testing_cmd:
- continue
- return_code = subprocess.call(
- command_obj.testing_cmd,
- cwd=CHROME_SRC,
- env=dict(os.environ, BUILDBOT_TESTING='1'))
+ if command_obj.testing_cmd:
+ commands += command_obj.testing_cmd
else:
- return_code = subprocess.call(command, cwd=CHROME_SRC, env=env)
- if return_code != 0:
- return return_code
+ commands += command_obj.command
+ if options.TESTING:
+ return_code = subprocess.call(
+ ['bash', '-exc', '; '.join(commands)], cwd=CHROME_SRC,
+ env=dict(os.environ, BUILDBOT_TESTING='1'))
+ else:
+ return_code = subprocess.call(
+ ['bash', '-exc', '; '.join(commands)], cwd=CHROME_SRC)
+
+ if return_code != 0:
+ return return_code
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698