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

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

Issue 607593003: Telemetry: print available page set names when page set is not found (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 0e2770a443a35021c1b22c29b995cbcf09c08af8..df6cda405955573f80995de8a468fab7b29f07bb 100644
--- a/tools/telemetry/telemetry/test_runner.py
+++ b/tools/telemetry/telemetry/test_runner.py
@@ -161,9 +161,8 @@ class Run(command_line.OptparseCommand):
page_set_name = args.positional_args[1]
page_set_class = _MatchPageSetName(page_set_name)
if page_set_class is None:
- parser.error(
- 'Page set not found. Please specify the name of a valid page set.')
- #TODO(ariblue): Print available page sets.
+ parser.error("Page set %s not found. Available sets:\n%s" %
+ (page_set_name, _AvailablePageSetNamesString()))
class TestWrapper(benchmark.Benchmark):
test = test_class
@@ -233,6 +232,15 @@ def _MatchPageSetName(input_name):
return None
+def _AvailablePageSetNamesString():
+ result = ""
+ for base_dir in config.base_paths:
+ for p in discover.DiscoverClasses(base_dir, base_dir, page_set.PageSet,
+ index_by_class_name=True).values():
+ result += p.Name() + "\n"
+ return result
+
+
def _MatchTestName(input_test_name, exact_matches=True):
def _Matches(input_string, search_string):
if search_string.startswith(input_string):
« 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