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

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: rebase Created 7 years, 6 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 c510b097699891c69ace5bc25745063ce03a92a0..ef82ee6d656f35f9f4a05290c9ff26b1c9964f48 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)]
Isaac (away) 2013/06/05 03:03:07 Why are you changing this?
Siva Chandra 2013/06/05 21:04:28 This reply is for this comment and for another com
+
+ 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'
extra_gyp = 'extra_gyp_defines'
@@ -93,39 +88,34 @@ def GetBotStepMap():
bot_configs = [
# Main builders
- B('main-builder-dbg',
- ['bb_check_webview_licenses', 'bb_compile', 'bb_run_findbugs',
- 'bb_zip_build']),
- B('main-builder-rel', ['bb_compile', 'bb_zip_build']),
- B('main-clang-builder', compile_step, slave_props={extra_gyp: 'clang=1'}),
- B('main-clobber', compile_step),
- B('main-tests', std_test_steps, T(std_tests, [flakiness_server])),
+ B('main-builder-dbg', std_build_opts + std_host_tests),
+ B('main-builder-rel', std_build_opts),
+ B('main-clang-builder', compile_opt),
+ B('main-clobber', compile_opt),
+ B('main-tests', std_test_opts, T(std_tests, [flakiness_server])),
# 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: 'asan=1'}),
- B('chromedriver-fyi-tests-dbg', std_test_steps,
+ B('chromedriver-fyi-tests-dbg', std_test_opts,
T(['chromedriver'], ['--install=ChromiumTestShell'])),
B('fyi-builder-dbg',
- ['bb_check_webview_licenses', 'bb_compile', 'bb_compile_experimental',
- 'bb_run_findbugs', 'bb_zip_build']),
- B('fyi-builder-rel',
- ['bb_compile', 'bb_compile_experimental', 'bb_zip_build']),
- B('fyi-tests-dbg-ics-gn', ['bb_compile', 'bb_compile_experimental'],
+ std_build_opts + std_host_tests + ['--experimental']),
+ B('fyi-builder-rel', std_build_opts + ['--experimental']),
+ B('fyi-tests-dbg-ics-gn', compile_opt + [ '--experimental'],
+ T(std_tests, ['--experimental', flakiness_server])),
+ B('fyi-tests', std_test_opts,
T(std_tests, ['--experimental', flakiness_server])),
- B('fyi-tests', std_test_steps,
+ B('fyi-component-builder-tests-dbg', compile_opt,
T(std_tests, ['--experimental', flakiness_server])),
- B('fyi-component-builder-tests-dbg', compile_step,
- T(std_tests, ['--experimental', flakiness_server]),
- {extra_gyp: 'component=shared_library'}),
- B('perf-tests-rel', std_test_steps, T([], ['--install=ContentShell'])),
- B('webkit-latest-webkit-tests', std_test_steps,
+ B('perf-tests-rel', std_test_opts, T([], ['--install=ContentShell'])),
+ B('webkit-latest-webkit-tests', std_test_opts,
T(['webkit_layout', 'webkit'])),
- B('webkit-latest-contentshell', compile_step, T(['webkit_layout'])),
- B('builder-unit-tests', compile_step, T(['unit'])),
+ B('webkit-latest-contentshell', compile_opt, T(['webkit_layout'])),
+ B('builder-unit-tests', compile_opt, T(['unit'])),
# Generic builder config (for substring match).
- B('builder', std_build_steps),
+ B('builder', std_build_opts),
]
bot_map = dict((config.bot_id, config) for config in bot_configs)
@@ -203,26 +193,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:
Isaac (away) 2013/06/05 03:03:07 why are you removing this?
- 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,
Isaac (away) 2013/06/05 03:03:07 why are you combining the commands?
+ 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