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

Side by Side Diff: build/android/buildbot/tests/bb_run_bot_test.py

Issue 18202005: [Android] Refactor buildbot tests so that they can be used downstream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the error message generic Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import subprocess 7 import subprocess
8 import sys 8 import sys
9 9
10 BUILDBOT_DIR = os.path.join(os.path.dirname(__file__), '..') 10 BUILDBOT_DIR = os.path.join(os.path.dirname(__file__), '..')
11 sys.path.append(BUILDBOT_DIR) 11 sys.path.append(BUILDBOT_DIR)
12 import bb_run_bot 12 import bb_run_bot
13 13
14 def RunBotsWithTesting(bot_step_map): 14 def RunBotProcesses(bot_process_map):
15 code = 0 15 code = 0
16 procs = [ 16 for bot, proc in bot_process_map:
17 (bot, subprocess.Popen(
18 [os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,
19 '--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
20 for bot in bot_step_map]
21 for bot, proc in procs:
22 _, err = proc.communicate() 17 _, err = proc.communicate()
23 code |= proc.returncode 18 code |= proc.returncode
24 if proc.returncode != 0: 19 if proc.returncode != 0:
25 print 'Error running bb_run_bot with id="%s"' % bot, err 20 print 'Error running the bot script with id="%s"' % bot, err
26 21
27 return code 22 return code
28 23
29 24
30 def main(): 25 def main():
31 return RunBotsWithTesting(bb_run_bot.GetBotStepMap()) 26 procs = [
27 (bot, subprocess.Popen(
28 [os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot,
29 '--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE))
30 for bot in bb_run_bot.GetBotStepMap()]
31 return RunBotProcesses(procs)
32 32
33 33
34 if __name__ == '__main__': 34 if __name__ == '__main__':
35 sys.exit(main()) 35 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698