OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import collections | 7 import collections |
8 import copy | 8 import copy |
9 import json | 9 import json |
10 import os | 10 import os |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 ['/bin/hostname', '-f'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 277 ['/bin/hostname', '-f'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
278 hostname_stdout, hostname_stderr = proc.communicate() | 278 hostname_stdout, hostname_stderr = proc.communicate() |
279 if proc.returncode == 0: | 279 if proc.returncode == 0: |
280 print 'Running on: ' + hostname_stdout | 280 print 'Running on: ' + hostname_stdout |
281 else: | 281 else: |
282 print >> sys.stderr, 'WARNING: failed to run hostname' | 282 print >> sys.stderr, 'WARNING: failed to run hostname' |
283 print >> sys.stderr, hostname_stdout | 283 print >> sys.stderr, hostname_stdout |
284 print >> sys.stderr, hostname_stderr | 284 print >> sys.stderr, hostname_stderr |
285 sys.exit(1) | 285 sys.exit(1) |
286 | 286 |
| 287 # TODO(phajdan.jr): Remove hack for http://crbug.com/378779 . |
| 288 if hostname_stdout == 'build1-a1.perf.chromium.org': |
| 289 if os.path.exists('/b/build/slave/Android_Builder__dbg_378779'): |
| 290 print '/b/build/slave/Android_Builder__dbg_378779 exists, skipping' |
| 291 else: |
| 292 print 'CLEANING UP CHECKOUT DIRECTORY HACK SEE http://crbug.com/378779' |
| 293 shutil.move('/b/build/slave/Android_Builder__dbg_', |
| 294 '/b/build/slave/Android_Builder__dbg_378779') |
| 295 |
287 parser = GetRunBotOptParser() | 296 parser = GetRunBotOptParser() |
288 options, args = parser.parse_args(argv[1:]) | 297 options, args = parser.parse_args(argv[1:]) |
289 if args: | 298 if args: |
290 parser.error('Unused args: %s' % args) | 299 parser.error('Unused args: %s' % args) |
291 | 300 |
292 bot_config = GetBotConfig(options, GetBotStepMap()) | 301 bot_config = GetBotConfig(options, GetBotStepMap()) |
293 if not bot_config: | 302 if not bot_config: |
294 sys.exit(1) | 303 sys.exit(1) |
295 | 304 |
296 print 'Using config:', bot_config | 305 print 'Using config:', bot_config |
297 | 306 |
298 commands = GetCommands(options, bot_config) | 307 commands = GetCommands(options, bot_config) |
299 for command in commands: | 308 for command in commands: |
300 print 'Will run: ', bb_utils.CommandToString(command) | 309 print 'Will run: ', bb_utils.CommandToString(command) |
301 print | 310 print |
302 | 311 |
303 env = GetEnvironment(bot_config.host_obj, options.testing) | 312 env = GetEnvironment(bot_config.host_obj, options.testing) |
304 return RunBotCommands(options, commands, env) | 313 return RunBotCommands(options, commands, env) |
305 | 314 |
306 | 315 |
307 if __name__ == '__main__': | 316 if __name__ == '__main__': |
308 sys.exit(main(sys.argv)) | 317 sys.exit(main(sys.argv)) |
OLD | NEW |