| OLD | NEW |
| 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 | 14 |
| 15 def main(): | 15 def main(): |
| 16 code = 0 | 16 code = 0 |
| 17 for bot_id in bb_run_bot.GetBotStepMap(): | 17 procs = [ |
| 18 proc = subprocess.Popen( | 18 (bot, subprocess.Popen( |
| 19 [os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot_id, | 19 [os.path.join(BUILDBOT_DIR, 'bb_run_bot.py'), '--bot-id', bot, |
| 20 '--TESTING'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 20 '--testing'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)) |
| 21 for bot in bb_run_bot.GetBotStepMap()] |
| 22 for bot, proc in procs: |
| 21 _, err = proc.communicate() | 23 _, err = proc.communicate() |
| 22 code |= proc.returncode | 24 code |= proc.returncode |
| 23 if proc.returncode != 0: | 25 if proc.returncode != 0: |
| 24 print 'Error running bb_run_bot with id="%s"' % bot_id, err | 26 print 'Error running bb_run_bot with id="%s"' % bot, err |
| 25 | 27 |
| 26 return code | 28 return code |
| 27 | 29 |
| 28 | 30 |
| 29 if __name__ == '__main__': | 31 if __name__ == '__main__': |
| 30 sys.exit(main()) | 32 sys.exit(main()) |
| OLD | NEW |