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 e2b0a48971e0afef5b2f4ad613ac22de8bc7e25f..9cc7952219077cc530fb4dc892b4c623c7ae69b0 100755 |
--- a/build/android/buildbot/bb_run_bot.py |
+++ b/build/android/buildbot/bb_run_bot.py |
@@ -22,7 +22,8 @@ CHROME_SRC = os.path.abspath( |
GLOBAL_SLAVE_PROPS = {} |
BotConfig = collections.namedtuple( |
- 'BotConfig', ['bot_id', 'bash_funs', 'test_obj', 'slave_props']) |
+ 'BotConfig', ['bot_id', 'bash_funs', 'host_obj', 'test_obj', 'slave_props']) |
+HostConfig = collections.namedtuple('HostConfig', ['steps', 'extra_args']) |
TestConfig = collections.namedtuple('Tests', ['tests', 'extra_args']) |
Command = collections.namedtuple( |
'Command', ['step_name', 'command', 'testing_cmd']) |
@@ -46,21 +47,27 @@ 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]) |
- ] |
+ 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)] |
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)) |
+ commands.append(Command(None, ['; '.join(bot_config.bash_funs)], None)) |
+ |
+ host_obj = bot_config.host_obj |
+ if host_obj: |
+ host_cmd = [ |
+ 'build/android/buildbot/bb_host_steps.py'] + property_args[0:2] |
+ if host_obj.steps: |
+ host_cmd.append('--steps=%s' % ','.join(host_obj.steps)) |
+ if host_obj.extra_args: |
+ host_cmd += host_obj.extra_args |
+ cmd = ' '.join(map(pipes.quote, host_cmd)) |
+ commands.append(Command('Host steps', [cmd], [cmd])) |
test_obj = bot_config.test_obj |
if test_obj: |
@@ -70,9 +77,8 @@ 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 |
@@ -87,42 +93,46 @@ def GetBotStepMap(): |
B = BotConfig |
def T(tests, extra_args=None): |
return TestConfig(tests, extra_args) |
+ def H(steps, extra_args=None): |
+ return HostConfig(steps, extra_args) |
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-dbg', [], |
+ H(['check_webview_licenses', 'compile', 'findbugs', '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]), |
+ ['bb_compile', 'bb_zip_build'], None, None, None), |
+ B('main-clang-builder', compile_step, None, None, None), |
+ B('main-clobber', compile_step, None, None, None), |
+ B('main-tests', std_test_steps, None, T(std_tests, [flakiness_server]), |
None), |
# Other waterfalls |
- B('asan-builder-tests', compile_step + ['bb_asan_tests_setup'], |
+ B('asan-builder-tests', compile_step + ['bb_asan_tests_setup'], None, |
T(std_tests, ['--asan']), {'extra_gyp_defines': 'asan=1'}), |
- B('chromedriver-fyi-tests-dbg', std_test_steps, T(['chromedriver']), |
+ B('chromedriver-fyi-tests-dbg', std_test_steps, None, T(['chromedriver']), |
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-dbg', [], |
+ H(['check_webview_licenses', 'compile', 'compile_experimental', |
+ 'findbugs', 'zip_build']), None, None), |
B('fyi-builder-rel', |
- ['bb_compile', 'bb_compile_experimental', 'bb_zip_build'], None, None), |
- B('fyi-tests', std_test_steps, |
+ ['bb_compile', 'bb_compile_experimental', 'bb_zip_build'], None, None, |
+ None), |
+ B('fyi-tests', std_test_steps, None, |
T(std_tests, ['--experimental', flakiness_server]), None), |
- B('fyi-component-builder-tests-dbg', compile_step, |
+ B('fyi-component-builder-tests-dbg', compile_step, None, |
T(std_tests, ['--experimental', flakiness_server]), None), |
- B('perf-tests-rel', std_test_steps, |
+ B('perf-tests-rel', std_test_steps, None, |
T([], ['--install=ContentShell']), |
None), |
- B('webkit-latest-webkit-tests', std_test_steps, |
+ B('webkit-latest-webkit-tests', std_test_steps, None, |
T(['webkit_layout', 'webkit']), None), |
- B('webkit-latest-contentshell', compile_step, T(['webkit_layout']), None), |
+ B('webkit-latest-contentshell', compile_step, None, T(['webkit_layout']), |
+ None), |
# Generic builder config (for substring match). |
- B('builder', std_build_steps, None, None), |
+ B('builder', std_build_steps, None, None, None), |
] |
bot_map = dict((config.bot_id, config) for config in bot_configs) |
@@ -202,24 +212,38 @@ def main(argv): |
for command_obj in command_objs: |
print 'Will run:', 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) |
+# 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')) |
+# else: |
+# return_code = subprocess.call(command, cwd=CHROME_SRC, env=env) |
+ if return_code != 0: |
+ return return_code |
if __name__ == '__main__': |