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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 ['/bin/hostname', '-f'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 279 ['/bin/hostname', '-f'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
280 hostname_stdout, hostname_stderr = proc.communicate() | 280 hostname_stdout, hostname_stderr = proc.communicate() |
281 if proc.returncode == 0: | 281 if proc.returncode == 0: |
282 print 'Running on: ' + hostname_stdout | 282 print 'Running on: ' + hostname_stdout |
283 else: | 283 else: |
284 print >> sys.stderr, 'WARNING: failed to run hostname' | 284 print >> sys.stderr, 'WARNING: failed to run hostname' |
285 print >> sys.stderr, hostname_stdout | 285 print >> sys.stderr, hostname_stdout |
286 print >> sys.stderr, hostname_stderr | 286 print >> sys.stderr, hostname_stderr |
287 sys.exit(1) | 287 sys.exit(1) |
288 | 288 |
289 # TODO(phajdan.jr): Remove hack for http://crbug.com/378779 . | |
290 if (hostname_stdout == 'build1-a1.perf.chromium.org' or | |
291 os.path.exists('/b/build/slave/Android_Builder__dbg_')): | |
292 if os.path.exists('/b/build/slave/Android_Builder__dbg_378779'): | |
293 print '/b/build/slave/Android_Builder__dbg_378779 exists, skipping' | |
294 else: | |
295 print 'CLEANING UP CHECKOUT DIRECTORY HACK SEE http://crbug.com/378779' | |
296 os.rename('/b/build/slave/Android_Builder__dbg_', | |
297 '/b/build/slave/Android_Builder__dbg_378779') | |
298 | |
299 parser = GetRunBotOptParser() | 289 parser = GetRunBotOptParser() |
300 options, args = parser.parse_args(argv[1:]) | 290 options, args = parser.parse_args(argv[1:]) |
301 if args: | 291 if args: |
302 parser.error('Unused args: %s' % args) | 292 parser.error('Unused args: %s' % args) |
303 | 293 |
304 bot_config = GetBotConfig(options, GetBotStepMap()) | 294 bot_config = GetBotConfig(options, GetBotStepMap()) |
305 if not bot_config: | 295 if not bot_config: |
306 sys.exit(1) | 296 sys.exit(1) |
307 | 297 |
308 print 'Using config:', bot_config | 298 print 'Using config:', bot_config |
309 | 299 |
310 commands = GetCommands(options, bot_config) | 300 commands = GetCommands(options, bot_config) |
311 for command in commands: | 301 for command in commands: |
312 print 'Will run: ', bb_utils.CommandToString(command) | 302 print 'Will run: ', bb_utils.CommandToString(command) |
313 print | 303 print |
314 | 304 |
315 env = GetEnvironment(bot_config.host_obj, options.testing) | 305 env = GetEnvironment(bot_config.host_obj, options.testing) |
316 return RunBotCommands(options, commands, env) | 306 return RunBotCommands(options, commands, env) |
317 | 307 |
318 | 308 |
319 if __name__ == '__main__': | 309 if __name__ == '__main__': |
320 sys.exit(main(sys.argv)) | 310 sys.exit(main(sys.argv)) |
OLD | NEW |