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

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

Issue 12758002: Add android buildbot support for exe tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: syntax fix Created 7 years, 9 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 c623f66d6ffdd9b6b484ea9b50a53c380e95c3ad..02ce848415fd7248441531cdc43e9fa63431c1b1 100755
--- a/build/android/buildbot/bb_run_bot.py
+++ b/build/android/buildbot/bb_run_bot.py
@@ -23,7 +23,8 @@ GLOBAL_SLAVE_PROPS = {}
BotConfig = collections.namedtuple(
'BotConfig', ['bot_id', 'bash_funs', 'test_obj', 'slave_props'])
TestConfig = collections.namedtuple('Tests', ['tests', 'extra_args'])
-Command = collections.namedtuple('Command', ['step_name', 'command'])
+Command = collections.namedtuple(
+ 'Command', ['step_name', 'command', 'supports_testing'])
def GetCommands(options, bot_config):
@@ -45,13 +46,20 @@ def GetCommands(options, bot_config):
'--slave-properties=%s' % json.dumps(slave_props)]
commands = []
- if bot_config.bash_funs:
- bash_base = [
+ 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(property_args))]
- commands.append(Command(
- None, ['bash', '-exc', '; '.join(bash_base + bot_config.bash_funs)]))
+ '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)), False))
test_obj = bot_config.test_obj
if test_obj:
@@ -61,7 +69,9 @@ 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', run_test_cmd))
+ commands.append(Command(
+ 'Run tests',
+ WrapWithBash(' '.join(map(pipes.quote, run_test_cmd))), True))
return commands
@@ -188,8 +198,7 @@ def main(argv):
sys.stdout.flush()
env = None
if options.TESTING:
- # The bash command doesn't yet support the testing option.
- if command[0] == 'bash':
+ if not command_obj.supports_testing:
continue
env = dict(os.environ)
env['BUILDBOT_TESTING'] = '1'

Powered by Google App Engine
This is Rietveld 408576698