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

Unified Diff: tools/perf/benchmarks/benchmark_unittest.py

Issue 2199333005: [tools/perf] Add unittests coverage for system health benchmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 4 years, 4 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 | tools/perf/benchmarks/system_health.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/benchmark_unittest.py
diff --git a/tools/perf/benchmarks/benchmark_unittest.py b/tools/perf/benchmarks/benchmark_unittest.py
index 82cb87e0e05413750c8a6a24146e35b1871bde8b..d35d012947759dcc18054ada51beee72061be9fd 100644
--- a/tools/perf/benchmarks/benchmark_unittest.py
+++ b/tools/perf/benchmarks/benchmark_unittest.py
@@ -5,9 +5,9 @@
"""For all the benchmarks that set options, test that the options are valid."""
from collections import defaultdict
-import os
import unittest
+from core import path_util
from core import perf_benchmark
from telemetry import benchmark as benchmark_module
@@ -16,15 +16,10 @@ from telemetry.internal.browser import browser_options
from telemetry.testing import progress_reporter
-def _GetPerfDir(*subdirs):
- perf_dir = os.path.dirname(os.path.dirname(__file__))
- return os.path.join(perf_dir, *subdirs)
-
-
def _GetAllPerfBenchmarks():
return discover.DiscoverClasses(
- _GetPerfDir('benchmarks'), _GetPerfDir(), benchmark_module.Benchmark,
- index_by_class_name=True).values()
+ path_util.GetPerfBenchmarksDir(), path_util.GetPerfDir(),
+ benchmark_module.Benchmark, index_by_class_name=True).values()
def _BenchmarkOptionsTestGenerator(benchmark):
@@ -81,12 +76,12 @@ def _AddBenchmarkOptionsTests(suite):
setattr(BenchmarkOptionsTest, benchmark.Name(),
_BenchmarkOptionsTestGenerator(benchmark))
suite.addTest(BenchmarkOptionsTest(benchmark.Name()))
- suite.addTest(TestNoBenchmarkNamesDuplication())
- suite.addTest(TestNoOverrideCustomizeBrowserOptions())
def load_tests(loader, standard_tests, pattern):
- del loader, standard_tests, pattern # unused
+ del loader, pattern # unused
suite = progress_reporter.TestSuite()
+ for t in standard_tests:
+ suite.addTests(t)
_AddBenchmarkOptionsTests(suite)
return suite
« no previous file with comments | « no previous file | tools/perf/benchmarks/system_health.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698