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

Unified Diff: telemetry/telemetry/benchmark_runner.py

Issue 3021433002: [Telemetry] Make `run_benchmark list` support SUPPORTED_PLATFORMS and StoryExpectations. (Closed)
Patch Set: Move back to function Created 3 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
Index: telemetry/telemetry/benchmark_runner.py
diff --git a/telemetry/telemetry/benchmark_runner.py b/telemetry/telemetry/benchmark_runner.py
index 60648a0688f1fce4b5c615b16a03a9a59c88e42e..5fb74c5efa930f676ce75e58e7cb2d98f2ccd69e 100644
--- a/telemetry/telemetry/benchmark_runner.py
+++ b/telemetry/telemetry/benchmark_runner.py
@@ -39,9 +39,18 @@ DEFAULT_LOG_FORMAT = (
'%(message)s')
-def _IsBenchmarkEnabled(benchmark_class, possible_browser):
- return (issubclass(benchmark_class, benchmark.Benchmark) and
- decorators.IsBenchmarkEnabled(benchmark_class, possible_browser))
+def _IsBenchmarkEnabled(bench, possible_browser):
+ b = bench()
+ expectations = b.GetExpectations()
+ return (
+ # Test that the current platform is supported.
+ any(t.ShouldDisable(possible_browser.platform, possible_browser)
+ for t in b.SUPPORTED_PLATFORMS) and
+ # Test that expectations say it is enabled.
+ not expectations.IsBenchmarkDisabled(possible_browser.platform,
+ possible_browser)
+ # Test that benchmark.ShouldDisable() isn't true.
+ and not b.ShouldDisable(possible_browser))
def PrintBenchmarkList(benchmarks, possible_browser, output_pipe=sys.stdout):
« no previous file with comments | « no previous file | telemetry/telemetry/benchmark_runner_unittest.py » ('j') | telemetry/telemetry/benchmark_runner_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698