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

Unified Diff: tools/telemetry/telemetry/test_runner.py

Issue 584023003: Revert of Telemetry: Use the leftmost argument to find the test to parse flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/test_runner.py
diff --git a/tools/telemetry/telemetry/test_runner.py b/tools/telemetry/telemetry/test_runner.py
index e769ba1297c50cc5eb6e68f5da96b7106ad202f9..7fbbd8f90c1ac0bb4651e495228cb1bb10d7adfd 100644
--- a/tools/telemetry/telemetry/test_runner.py
+++ b/tools/telemetry/telemetry/test_runner.py
@@ -111,23 +111,15 @@
def AddCommandLineArgs(cls, parser):
benchmark.AddCommandLineArgs(parser)
- # TODO(jbroman): This compensates for the fact that the "run" command
- # may or may not be given on the command line. It's inelegant.
- if len(sys.argv) > 2 and 'run'.startswith(sys.argv[1]):
- test_name = sys.argv[2]
- elif len(sys.argv) > 1:
- test_name = sys.argv[1]
- else:
- # No arguments, so no more flags needed.
- return
-
# Allow tests to add their own command line options.
- matching_tests = _MatchTestName(test_name)
+ matching_tests = []
+ for arg in sys.argv[1:]:
+ matching_tests += _MatchTestName(arg)
if matching_tests:
# TODO(dtu): After move to argparse, add command-line args for all tests
# to subparser. Using subparsers will avoid duplicate arguments.
- matching_test = matching_tests[0]
+ matching_test = matching_tests.pop()
matching_test.AddCommandLineArgs(parser)
# The test's options override the defaults!
matching_test.SetArgumentDefaults(parser)
@@ -254,8 +246,6 @@
for test_class in _Tests():
if exact_match == test_class.Name():
return [test_class]
- # TODO(jbroman): [] is the correct result when no exact match is found.
- # However, some bots rely on this falling through right now.
# Fuzzy matching.
return [test_class for test_class in _Tests()
« 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