| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """Defer to --brave-new-test-launcher.""" | |
| 7 | |
| 8 import os | |
| 9 import optparse | |
| 10 import subprocess | |
| 11 import sys | |
| 12 | |
| 13 | |
| 14 def main(): | |
| 15 parser = optparse.OptionParser() | |
| 16 | |
| 17 group = optparse.OptionGroup( | |
| 18 parser, 'Compability flag with the old sharding_supervisor') | |
| 19 group.add_option( | |
| 20 '--no-color', action='store_true', help='Ignored') | |
| 21 group.add_option( | |
| 22 '--retry-failed', action='store_true', help='Ignored') | |
| 23 group.add_option( | |
| 24 '-t', '--timeout', type='int', help='Kept as --timeout') | |
| 25 group.add_option( | |
| 26 '--total-slaves', type='int', default=1, help='Converted to --index') | |
| 27 group.add_option( | |
| 28 '--slave-index', type='int', default=0, help='Converted to --shards') | |
| 29 parser.add_option_group(group) | |
| 30 group = optparse.OptionGroup( | |
| 31 parser, 'Options of run_test_cases.py passed through') | |
| 32 group.add_option( | |
| 33 '--retries', type='int', help='Kept as --retries') | |
| 34 group.add_option( | |
| 35 '-j', '--jobs', type='int', help='Number of parallel jobs') | |
| 36 group.add_option( | |
| 37 '--clusters', type='int', help='Maximum number of tests in a batch') | |
| 38 group.add_option( | |
| 39 '--verbose', action='count', default=0, help='Kept as --verbose') | |
| 40 parser.add_option_group(group) | |
| 41 | |
| 42 parser.disable_interspersed_args() | |
| 43 options, args = parser.parse_args() | |
| 44 | |
| 45 env = os.environ | |
| 46 env['GTEST_TOTAL_SHARDS'] = str(options.total_slaves) | |
| 47 env['GTEST_SHARD_INDEX'] = str(options.slave_index) | |
| 48 | |
| 49 if options.jobs: | |
| 50 args.append('--test-launcher-jobs=%d' % options.jobs) | |
| 51 | |
| 52 if options.clusters: | |
| 53 args.append('--test-launcher-batch-limit=%d' % options.clusters) | |
| 54 | |
| 55 return subprocess.Popen(args + ['--brave-new-test-launcher'], env=env).wait() | |
| 56 | |
| 57 | |
| 58 if __name__ == '__main__': | |
| 59 sys.exit(main()) | |
| OLD | NEW |