| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 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 """Runs all types of tests from one unified interface.""" | 7 """Runs all types of tests from one unified interface.""" |
| 8 | 8 |
| 9 import argparse | 9 import argparse |
| 10 import collections | 10 import collections |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 def AddRemoteDeviceOptions(parser): | 121 def AddRemoteDeviceOptions(parser): |
| 122 group = parser.add_argument_group('Remote Device Options') | 122 group = parser.add_argument_group('Remote Device Options') |
| 123 | 123 |
| 124 group.add_argument('--trigger', | 124 group.add_argument('--trigger', |
| 125 help=('Only triggers the test if set. Stores test_run_id ' | 125 help=('Only triggers the test if set. Stores test_run_id ' |
| 126 'in given file path. ')) | 126 'in given file path. ')) |
| 127 group.add_argument('--collect', | 127 group.add_argument('--collect', |
| 128 help=('Only collects the test results if set. ' | 128 help=('Only collects the test results if set. ' |
| 129 'Gets test_run_id from given file path.')) | 129 'Gets test_run_id from given file path.')) |
| 130 group.add_argument('--num-shards', type=int, |
| 131 help='Number of devices to shard the test across.') |
| 130 group.add_argument('--remote-device', action='append', | 132 group.add_argument('--remote-device', action='append', |
| 131 help='Device type to run test on.') | 133 help='Device type to run test on.') |
| 132 group.add_argument('--results-path', | 134 group.add_argument('--results-dir', |
| 133 help='File path to download results to.') | 135 help='Directory to put the downloaded results files in.') |
| 134 group.add_argument('--api-protocol', | 136 group.add_argument('--api-protocol', |
| 135 help='HTTP protocol to use. (http or https)') | 137 help='HTTP protocol to use. (http or https)') |
| 136 group.add_argument('--api-address', | 138 group.add_argument('--api-address', |
| 137 help='Address to send HTTP requests.') | 139 help='Address to send HTTP requests.') |
| 138 group.add_argument('--api-port', | 140 group.add_argument('--api-port', |
| 139 help='Port to send HTTP requests to.') | 141 help='Port to send HTTP requests to.') |
| 140 group.add_argument('--runner-type', | 142 group.add_argument('--test-framework', |
| 141 help='Type of test to run as.') | 143 help='Test framework to run test.') |
| 142 group.add_argument('--runner-package', | 144 group.add_argument('--runner-package', |
| 143 help='Package name of test.') | 145 help='Package name of test.') |
| 144 group.add_argument('--device-type', | 146 group.add_argument('--device-type', |
| 145 choices=constants.VALID_DEVICE_TYPES, | 147 choices=constants.VALID_DEVICE_TYPES, |
| 146 help=('Type of device to run on. iOS or android')) | 148 help=('Type of device to run on. iOS or android')) |
| 147 group.add_argument('--device-oem', action='append', | 149 group.add_argument('--device-oem', action='append', |
| 148 help='Device OEM to run on.') | 150 help='Device OEM to run on.') |
| 149 group.add_argument('--remote-device-file', | 151 group.add_argument('--remote-device-file', |
| 150 help=('File with JSON to select remote device. ' | 152 help=('File with JSON to select remote device. ' |
| 151 'Overrides all other flags.')) | 153 'Overrides all other flags.')) |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 if e.is_infra_error: | 1003 if e.is_infra_error: |
| 1002 return constants.INFRA_EXIT_CODE | 1004 return constants.INFRA_EXIT_CODE |
| 1003 return constants.ERROR_EXIT_CODE | 1005 return constants.ERROR_EXIT_CODE |
| 1004 except: # pylint: disable=W0702 | 1006 except: # pylint: disable=W0702 |
| 1005 logging.exception('Unrecognized error occurred.') | 1007 logging.exception('Unrecognized error occurred.') |
| 1006 return constants.ERROR_EXIT_CODE | 1008 return constants.ERROR_EXIT_CODE |
| 1007 | 1009 |
| 1008 | 1010 |
| 1009 if __name__ == '__main__': | 1011 if __name__ == '__main__': |
| 1010 sys.exit(main()) | 1012 sys.exit(main()) |
| OLD | NEW |