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

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

Issue 745143003: [telemetry] Fix benchmark smoke unittest _disabled_strings logic, take 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/benchmark_smoke_unittest.py
diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py
index 97dd867e1e715ff879590f32b09607a6fdce3eb2..ea0b9d401841e4ec0db9c61f2c7cd01a6fb26237 100644
--- a/tools/perf/benchmarks/benchmark_smoke_unittest.py
+++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py
@@ -106,14 +106,16 @@ def load_tests(_, _2, _3):
# test from the class. We should probably discover all of the tests
# in a class, and then throw the ones we don't need away instead.
if hasattr(benchmark, '_enabled_strings'):
- if hasattr(method, '_enabled_strings'):
+ if (hasattr(method, '_enabled_strings') and
+ method._enabled_strings and benchmark._enabled_strings):
method._enabled_strings += benchmark._enabled_strings
- else:
+ elif not hasattr(method, '_enabled_strings') or method._enabled_strings:
method._enabled_strings = benchmark._enabled_strings
if hasattr(benchmark, '_disabled_strings'):
- if hasattr(method, '_disabled_strings'):
+ if (hasattr(method, '_disabled_strings') and
+ method._disabled_strings and benchmark._disabled_strings):
method._disabled_strings += benchmark._disabled_strings
- else:
+ elif not hasattr(method, '_disabled_strings') or method._disabled_strings:
method._disabled_strings = benchmark._disabled_strings
setattr(BenchmarkSmokeTest, benchmark.Name(), method)
« 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