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

Unified Diff: build/android/test_runner.py

Issue 66373004: Android: allow a --single-step for test_runner.py perf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 7 years, 1 month 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/test_runner.py ('k') | no next file » | 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 55786cdf445fbc0c2b694e8ad5aaeaa855986154..2f4f07b560363bd8620a2e76a8a7538668bab6da 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -434,11 +434,18 @@ def AddPerfTestOptions(option_parser):
option_parser.usage = '%prog perf [options]'
option_parser.commands_dict = {}
- option_parser.example = ('%prog perf --steps perf_steps.json')
+ option_parser.example = ('%prog perf '
+ '[--single-step command] or '
+ '[--steps perf_steps.json] or '
+ '[--print-step step]')
option_parser.add_option(
+ '--single-step',
+ help='Execute the given command with retries, but only print the result '
+ 'for the "most successful" round.')
+ option_parser.add_option(
'--steps',
- help='JSON file containing the list of perf steps to run.')
+ help='JSON file containing the list of commands to run.')
option_parser.add_option(
'--flaky-steps',
help=('A JSON file containing steps that are flaky '
@@ -471,11 +478,15 @@ def ProcessPerfTestOptions(options, error_func):
A PerfOptions named tuple which contains all options relevant to
perf tests.
"""
- if not options.steps and not options.print_step:
- error_func('Please specify --steps or --print-step')
+ # Only one of steps, print_step or single_step must be provided.
+ count = len(filter(None,
+ [options.steps, options.print_step, options.single_step]))
+ if count != 1:
+ error_func('Please specify one of: --steps, --print-step, --single-step.')
return perf_test_options.PerfOptions(
options.steps, options.flaky_steps, options.print_step,
- options.no_timeout, options.test_filter, options.dry_run)
+ options.no_timeout, options.test_filter, options.dry_run,
+ options.single_step)
def _RunGTests(options, error_func, devices):
@@ -633,6 +644,10 @@ def _RunPerfTests(options, error_func, devices):
results=results,
test_type='Perf',
test_package='Perf')
+
+ if perf_options.single_step:
+ return perf_test_runner.PrintTestOutput('single_step')
+
# Always return 0 on the sharding stage. Individual tests exit_code
# will be returned on the print_step stage.
return 0
« no previous file with comments | « build/android/pylib/perf/test_runner.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698