Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: build/android/test_runner.py

Issue 879983002: Add multiple device/os filtering and a config file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH'] 118 os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH']
119 119
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', default='', 124 group.add_argument('--trigger', default='',
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', default='', 127 group.add_argument('--collect', default='',
128 help=('Only collects the test results if set. ' 128 help=('Only collects the test results if set. '
jbudorick 2015/01/28 16:09:54 w.r.t. help formatting: like this
rnephew (Wrong account) 2015/01/28 16:47:53 Acknowledged.
129 'Gets test_run_id from given file path.')) 129 'Gets test_run_id from given file path.'))
130 group.add_argument('--remote-device', default='', 130 group.add_argument('--remote-device', action='append',
131 help='Device type to run test on.') 131 help='Device type to run test on.')
132 group.add_argument('--remote-device-os', default='',
133 help='OS to have on the device.')
134 group.add_argument('--results-path', default='', 132 group.add_argument('--results-path', default='',
135 help='File path to download results to.') 133 help='File path to download results to.')
136 group.add_argument('--api-protocol', 134 group.add_argument('--api-protocol',
137 help='HTTP protocol to use. (http or https)') 135 help='HTTP protocol to use. (http or https)')
138 group.add_argument('--api-address', help='Address to send HTTP requests.') 136 group.add_argument('--api-address', help='Address to send HTTP requests.')
139 group.add_argument('--api-port', help='Port to send HTTP requests to.') 137 group.add_argument('--api-port', help='Port to send HTTP requests to.')
140 group.add_argument('--runner-type', default='', 138 group.add_argument('--runner-type', default='',
141 help='Type of test to run as.') 139 help='Type of test to run as.')
142 group.add_argument('--runner-package', help='Package name of test.') 140 group.add_argument('--runner-package', help='Package name of test.')
143 group.add_argument('--device-type', default='Android', 141 group.add_argument('--device-type', default='Android',
144 choices=constants.VALID_DEVICE_TYPES, 142 choices=constants.VALID_DEVICE_TYPES,
145 help=('Type of device to run on. iOS or android')) 143 help=('Type of device to run on. iOS or android'))
144 group.add_argument('--device-oem', help='Device OEM to run on.')
145 group.add_argument('--remote-device-file', help=('File with JSON to select'
jbudorick 2015/01/28 16:09:54 nit: put help on its own line and indent subsequen
rnephew (Wrong account) 2015/01/28 16:47:53 Done.
146 ' remote device. Overrides all other flags.'))
147
148 device_os_group = group.add_mutually_exclusive_group()
jbudorick 2015/01/28 16:09:54 I still need to look at nested mutex groups.
rnephew (Wrong account) 2015/01/28 16:47:53 Looking around, everything I found says you cant d
jbudorick 2015/01/28 23:19:09 Yeah, it doesn't look like it works the way I'd li
rnephew (Wrong account) 2015/01/29 01:58:35 Acknowledged.
149 device_os_group.add_argument('--remote-device-minimum-os',
150 help='Minimum OS on device.')
151 device_os_group.add_argument('--remote-device-os', action='append',
152 help='OS to have on the device.')
146 153
147 api_secret_group = group.add_mutually_exclusive_group() 154 api_secret_group = group.add_mutually_exclusive_group()
148 api_secret_group.add_argument('--api-secret', default='', 155 api_secret_group.add_argument('--api-secret', default='',
149 help='API secret for remote devices.') 156 help='API secret for remote devices.')
150 api_secret_group.add_argument('--api-secret-file', default='', 157 api_secret_group.add_argument('--api-secret-file', default='',
151 help='Path to file that contains API secret.') 158 help='Path to file that contains API secret.')
152 159
153 api_key_group = group.add_mutually_exclusive_group() 160 api_key_group = group.add_mutually_exclusive_group()
154 api_key_group.add_argument('--api-key', default='', 161 api_key_group.add_argument('--api-key', default='',
155 help='API key for remote devices.') 162 help='API key for remote devices.')
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 subparser = command_parsers.add_parser( 996 subparser = command_parsers.add_parser(
990 test_type, usage='%(prog)s [options]', help=config.help_txt) 997 test_type, usage='%(prog)s [options]', help=config.help_txt)
991 config.add_options_func(subparser) 998 config.add_options_func(subparser)
992 999
993 args = parser.parse_args() 1000 args = parser.parse_args()
994 return RunTestsCommand(args, parser) 1001 return RunTestsCommand(args, parser)
995 1002
996 1003
997 if __name__ == '__main__': 1004 if __name__ == '__main__':
998 sys.exit(main()) 1005 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698