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

Unified Diff: tools/telemetry/telemetry/unittest_util/run_tests.py

Issue 902763002: Parallelize telemetry unit tests on Android bots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove fyi bot config (will create another CL for it) Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/unittest_util/browser_test_case.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/unittest_util/run_tests.py
diff --git a/tools/telemetry/telemetry/unittest_util/run_tests.py b/tools/telemetry/telemetry/unittest_util/run_tests.py
index 0f3343aa83200dbd239bcf08513dfde08ac89e8a..0d44f218d42d917434d352ee6e9513edfa8de9c9 100644
--- a/tools/telemetry/telemetry/unittest_util/run_tests.py
+++ b/tools/telemetry/telemetry/unittest_util/run_tests.py
@@ -8,6 +8,7 @@ from telemetry.core import browser_finder
from telemetry.core import browser_finder_exceptions
from telemetry.core import browser_options
from telemetry.core import command_line
+from telemetry.core import device_finder
from telemetry.core import util
from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import browser_test_case
@@ -96,11 +97,13 @@ class RunTestsCommand(command_line.OptparseCommand):
# are long-running, so there's a limit to how much parallelism we
# can effectively use for now anyway.
#
- # It should be possible to handle multiple devices if we adjust
- # the browser_finder code properly, but for now we only handle the one
- # on Android and ChromeOS.
- if possible_browser.platform.GetOSName() in ('android', 'chromeos'):
+ # It should be possible to handle multiple devices if we adjust the
+ # browser_finder code properly, but for now we only handle one on ChromeOS.
+ if possible_browser.platform.GetOSName() == 'chromeos':
runner.args.jobs = 1
+ elif possible_browser.platform.GetOSName() == 'android':
+ runner.args.jobs = len(device_finder.GetDevicesMatchingOptions(args))
+ print 'Running tests with %d Android device(s).' % runner.args.jobs
elif possible_browser.platform.GetOSVersionName() == 'xp':
# For an undiagnosed reason, XP falls over with more parallelism.
# See crbug.com/388256
@@ -172,6 +175,9 @@ def _MatchesSelectedTest(name, selected_tests, selected_tests_are_exact):
def _SetUpProcess(child, context): # pylint: disable=W0613
args = context
+ if args.device and args.device == 'android':
+ android_devices = device_finder.GetDevicesMatchingOptions(args)
+ args.device = android_devices[child.worker_num-1].guid
options_for_unittests.Push(args)
« no previous file with comments | « tools/telemetry/telemetry/unittest_util/browser_test_case.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698