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

Unified Diff: build/android/test_runner.py

Issue 2012323002: [Android] Implement perf tests to platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments in ps5 Created 4 years, 7 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 | « build/android/pylib/perf/perf_test_instance.py ('k') | build/android/test_runner.pydeps » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 8f0ac08edfe06ed8d25ed6a43024e5e2ab1e08b4..5bb9d62503d1e20a09eda24c55a609bbfce61f3e 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -594,6 +594,13 @@ def AddPerfTestOptions(parser):
help='Only starts tests when the battery is charged above '
'given level.')
group.add_argument('--known-devices-file', help='Path to known device list.')
+ group.add_argument(
+ '--repeat', dest='repeat', type=int, default=0,
+ help='Number of times to repeat the specified set of tests.')
+ group.add_argument('--break-on-failure', '--break_on_failure',
+ dest='break_on_failure', action='store_true',
+ help='Whether to break on failure.')
+
AddCommonOptions(parser)
AddDeviceOptions(parser)
@@ -686,6 +693,24 @@ def _RunMonkeyTests(args, devices):
return exit_code
+def RunPerfTestsInPlatformMode(args):
jbudorick 2016/06/01 21:16:09 Why can't this use the existing RunTestsInPlatform
rnephew (Reviews Here) 2016/06/01 22:14:15 Working on unifying them, will be in the next patc
rnephew (Reviews Here) 2016/06/02 18:43:26 Done.
+ def infra_error(message):
+ logging.fatal(message)
+ sys.exit(constants.INFRA_EXIT_CODE)
+
+ if args.single_step or args.steps:
+ return RunTestsInPlatformMode(args)
+
+ # These are not full perf test runs, they are for printing out past runs or
+ # lists of tests. As such, they do not require the retry logic or results
+ # logic. They only need to perform the action required and return the correct
+ # return code.
+ with environment_factory.CreateEnvironment(args, infra_error) as env:
+ with test_instance_factory.CreateTestInstance(args, infra_error) as test:
+ with test_run_factory.CreateTestRun(
+ args, env, test, infra_error) as test_run:
+ return test_run.RunTests()
+
def _RunPerfTests(args, active_devices):
"""Subcommand of RunTestsCommands which runs perf tests."""
perf_options = ProcessPerfTestOptions(args)
@@ -799,6 +824,8 @@ def RunTestsCommand(args): # pylint: disable=too-many-return-statements
if args.enable_platform_mode or command in ('gtest', 'instrumentation'):
return RunTestsInPlatformMode(args)
+ if command == 'perf':
jbudorick 2016/06/01 21:16:09 ... and to go along with that comment, these two l
rnephew (Reviews Here) 2016/06/01 22:14:15 Only here until I finally am ready to submit, then
+ return RunPerfTestsInPlatformMode(args)
forwarder.Forwarder.RemoveHostLog()
if not ports.ResetTestServerPortAllocation():
@@ -826,6 +853,7 @@ _SUPPORTED_IN_PLATFORM_MODE = [
# TODO(jbudorick): Add support for more test types.
'gtest',
'instrumentation',
+ 'perf',
'uirobot',
]
« no previous file with comments | « build/android/pylib/perf/perf_test_instance.py ('k') | build/android/test_runner.pydeps » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698