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

Side by Side Diff: build/android/pylib/perf/setup.py

Issue 2070043002: [Android] Fall back to active_devices if the known device list file is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generates test runner factory and tests for performance tests.""" 5 """Generates test runner factory and tests for performance tests."""
6 6
7 import json 7 import json
8 import fnmatch 8 import fnmatch
9 import logging 9 import logging
10 import os 10 import os
(...skipping 10 matching lines...) Expand all
21 # TODO(rnephew): Delete this when recipes change to pass file path. 21 # TODO(rnephew): Delete this when recipes change to pass file path.
22 if not devices_path: 22 if not devices_path:
23 logging.warning('Known devices file path not being passed. For device ' 23 logging.warning('Known devices file path not being passed. For device '
24 'affinity to work properly, it must be passed.') 24 'affinity to work properly, it must be passed.')
25 devices_path = os.path.join(os.environ.get('CHROMIUM_OUT_DIR', 'out'), 25 devices_path = os.path.join(os.environ.get('CHROMIUM_OUT_DIR', 'out'),
26 device_list.LAST_DEVICES_FILENAME) 26 device_list.LAST_DEVICES_FILENAME)
27 try: 27 try:
28 if devices_path: 28 if devices_path:
29 devices = [device_utils.DeviceUtils(s) 29 devices = [device_utils.DeviceUtils(s)
30 for s in device_list.GetPersistentDeviceList(devices_path)] 30 for s in device_list.GetPersistentDeviceList(devices_path)]
31 if not devices and active_devices:
32 logging.warning('%s is empty. Falling back to active devices.',
33 devices_path)
34 devices = active_devices
31 else: 35 else:
32 logging.warning('Known devices file path not being passed. For device ' 36 logging.warning('Known devices file path not being passed. For device '
33 'affinity to work properly, it must be passed.') 37 'affinity to work properly, it must be passed.')
34 devices = active_devices 38 devices = active_devices
35 except IOError as e: 39 except IOError as e:
36 logging.error('Unable to find %s [%s]', devices_path, e) 40 logging.error('Unable to find %s [%s]', devices_path, e)
37 devices = active_devices 41 devices = active_devices
38 return sorted(devices) 42 return sorted(devices)
39 43
40 44
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 if test_options.flaky_steps: 100 if test_options.flaky_steps:
97 with file(test_options.flaky_steps, 'r') as f: 101 with file(test_options.flaky_steps, 'r') as f:
98 flaky_steps = json.load(f) 102 flaky_steps = json.load(f)
99 103
100 def TestRunnerFactory(device, shard_index): 104 def TestRunnerFactory(device, shard_index):
101 return test_runner.TestRunner( 105 return test_runner.TestRunner(
102 test_options, device, shard_index, len(all_devices), 106 test_options, device, shard_index, len(all_devices),
103 steps_dict, flaky_steps) 107 steps_dict, flaky_steps)
104 108
105 return (TestRunnerFactory, sorted_step_names, all_devices) 109 return (TestRunnerFactory, sorted_step_names, all_devices)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698