0

[run_swarmed] Add an argument for device type.

In order to reproduce tests that only will run on phones.

Bug: 1072141
Change-Id: I649db24cd884d32327cb0d35a54dc08a35b3985d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159791
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762419}
This commit is contained in:
Jeffrey Cohen
2020-04-24 18:23:07 +00:00
committed by Commit Bot
parent 0c96d97c22
commit f128b51cfe

@@ -34,6 +34,8 @@ import sys
INTERNAL_ERROR_EXIT_CODE = -1000
DEFAULT_ANDROID_DEVICE_TYPE = "walleye"
def _ReadVpythonPin():
"""Reads the vpython CIPD package name and version from
@@ -93,8 +95,19 @@ def _Spawn(args):
'-d',
'cpu=' + args.arch,
]
# The aliases for device type are stored here:
# luci/appengine/swarming/ui2/modules/alias.js
# for example 'blueline' = 'Pixel 3'
if args.target_os == 'android':
if args.device_type is None and args.device_os is None:
trigger_args += ['-d', 'device_type=' + DEFAULT_ANDROID_DEVICE_TYPE]
if args.device_type:
trigger_args += ['-d', 'device_type=' + args.device_type]
if args.device_os:
trigger_args += ['-d', 'device_os=' + args.device_os]
# The canonical version numbers are stored in the infra repository here:
# build/scripts/slave/recipe_modules/swarming/api.py
#
@@ -182,8 +195,12 @@ def main():
help='path to isolate map file if not using default')
parser.add_argument('--copies', '-n', type=int, default=1,
help='Number of copies to spawn.')
parser.add_argument('--device-os', default='M',
help='Run tests on the given version of Android.')
parser.add_argument(
'--device-os', help='Run tests on the given version of Android.')
parser.add_argument(
'--device-type',
help='device_type specifier for Swarming'
' from https://chromium-swarm.appspot.com/botlist .')
# TODO(crbug.com/812428): Switch this back to chromium.tests once
# that pool runs with task templates.
parser.add_argument(