summaryrefslogtreecommitdiffstats
path: root/build/android
diff options
context:
space:
mode:
authorrnephew <rnephew@chromium.org>2016-02-26 10:29:05 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-26 18:30:05 +0000
commita66f5999867e3ccca361149c92af4f5625ded36b (patch)
treecec7a3d7608bb5175f66e8f1de4d744f1077fec6 /build/android
parentbbe710f407968b8f6f76864cbc98e4e81d806ac7 (diff)
downloadchromium_src-a66f5999867e3ccca361149c92af4f5625ded36b.zip
chromium_src-a66f5999867e3ccca361149c92af4f5625ded36b.tar.gz
chromium_src-a66f5999867e3ccca361149c92af4f5625ded36b.tar.bz2
[Android] Add known devices file argument to perf test runner.
Recent changes make the path to the known devices file configurable. This change makes the perf test runner aware of this. BUG=590229 Review URL: https://codereview.chromium.org/1736283002 Cr-Commit-Position: refs/heads/master@{#377926}
Diffstat (limited to 'build/android')
-rw-r--r--build/android/pylib/perf/setup.py21
-rw-r--r--build/android/pylib/perf/test_options.py1
-rwxr-xr-xbuild/android/test_runner.py4
3 files changed, 19 insertions, 7 deletions
diff --git a/build/android/pylib/perf/setup.py b/build/android/pylib/perf/setup.py
index dac7bae..31db14f 100644
--- a/build/android/pylib/perf/setup.py
+++ b/build/android/pylib/perf/setup.py
@@ -17,12 +17,21 @@ from pylib.perf import test_runner
from pylib.utils import test_environment
-def _GetAllDevices(active_devices):
- devices_path = os.path.join(os.environ.get('CHROMIUM_OUT_DIR', 'out'),
- device_list.LAST_DEVICES_FILENAME)
+def _GetAllDevices(active_devices, devices_path):
+ # TODO(rnephew): Delete this when recipes change to pass file path.
+ if not devices_path:
+ logging.warning('Known devices file path not being passed. For device '
+ 'affinity to work properly, it must be passed.')
+ devices_path = os.path.join(os.environ.get('CHROMIUM_OUT_DIR', 'out'),
+ device_list.LAST_DEVICES_FILENAME)
try:
- devices = [device_utils.DeviceUtils(s)
- for s in device_list.GetPersistentDeviceList(devices_path)]
+ if devices_path:
+ devices = [device_utils.DeviceUtils(s)
+ for s in device_list.GetPersistentDeviceList(devices_path)]
+ else:
+ logging.warning('Known devices file path not being passed. For device '
+ 'affinity to work properly, it must be passed.')
+ devices = active_devices
except IOError as e:
logging.error('Unable to find %s [%s]', devices_path, e)
devices = active_devices
@@ -74,7 +83,7 @@ def Setup(test_options, active_devices):
test_environment.CleanupLeftoverProcesses(active_devices)
# We want to keep device affinity, so return all devices ever seen.
- all_devices = _GetAllDevices(active_devices)
+ all_devices = _GetAllDevices(active_devices, test_options.known_devices_file)
steps_dict = _GetStepsDict(test_options)
sorted_step_names = sorted(steps_dict['steps'].keys())
diff --git a/build/android/pylib/perf/test_options.py b/build/android/pylib/perf/test_options.py
index 2764e42..4c923f3 100644
--- a/build/android/pylib/perf/test_options.py
+++ b/build/android/pylib/perf/test_options.py
@@ -20,4 +20,5 @@ PerfOptions = collections.namedtuple('PerfOptions', [
'get_output_dir_archive',
'max_battery_temp',
'min_battery_level',
+ 'known_devices_file',
])
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index ca6fe41..eed5c4d 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -684,6 +684,7 @@ def AddPerfTestOptions(parser):
group.add_argument('--min-battery-level', type=int,
help='Only starts tests when the battery is charged above '
'given level.')
+ group.add_argument('--known-devices-file', help='Path to known device list.')
AddCommonOptions(parser)
AddDeviceOptions(parser)
@@ -707,7 +708,8 @@ def ProcessPerfTestOptions(args):
args.print_step, args.no_timeout, args.test_filter,
args.dry_run, args.single_step, args.collect_chartjson_data,
args.output_chartjson_data, args.get_output_dir_archive,
- args.max_battery_temp, args.min_battery_level)
+ args.max_battery_temp, args.min_battery_level,
+ args.known_devices_file)
def AddPythonTestOptions(parser):