OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import unittest | 4 import unittest |
5 | 5 |
6 from core import perf_benchmark | 6 from core import perf_benchmark |
7 from core import perf_data_generator | 7 from core import perf_data_generator |
8 from core.perf_data_generator import BenchmarkMetadata | 8 from core.perf_data_generator import BenchmarkMetadata |
9 | 9 |
10 from telemetry import benchmark | 10 from telemetry import benchmark |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 def Name(cls): | 127 def Name(cls): |
128 return 'not_blacklisted' | 128 return 'not_blacklisted' |
129 | 129 |
130 swarming_dimensions = [ | 130 swarming_dimensions = [ |
131 {'os': 'SkyNet', 'id': 'T-850', 'pool': 'T-RIP', 'device_ids': ['a']} | 131 {'os': 'SkyNet', 'id': 'T-850', 'pool': 'T-RIP', 'device_ids': ['a']} |
132 ] | 132 ] |
133 test_config = { | 133 test_config = { |
134 'platform': 'android', | 134 'platform': 'android', |
135 'swarming_dimensions': swarming_dimensions, | 135 'swarming_dimensions': swarming_dimensions, |
136 } | 136 } |
| 137 sharding_map = {'1': {'blacklisted': 0, 'not_blacklisted': 0}} |
137 benchmarks = [BlacklistedBenchmark, NotBlacklistedBenchmark] | 138 benchmarks = [BlacklistedBenchmark, NotBlacklistedBenchmark] |
138 tests = perf_data_generator.generate_telemetry_tests( | 139 tests = perf_data_generator.generate_telemetry_tests( |
139 test_config, benchmarks, None, ['blacklisted']) | 140 test_config, benchmarks, sharding_map, ['blacklisted']) |
140 | 141 |
141 generated_test_names = set(t['name'] for t in tests) | 142 generated_test_names = set(t['name'] for t in tests) |
142 self.assertEquals( | 143 self.assertEquals( |
143 generated_test_names, | 144 generated_test_names, |
144 {'blacklisted', 'not_blacklisted', 'not_blacklisted.reference'}) | 145 {'blacklisted', 'not_blacklisted', 'not_blacklisted.reference'}) |
145 | 146 |
146 def testShouldBenchmarkBeScheduledNormal(self): | 147 def testShouldBenchmarkBeScheduledNormal(self): |
147 class bench(perf_benchmark.PerfBenchmark): | 148 class bench(perf_benchmark.PerfBenchmark): |
148 pass | 149 pass |
149 | 150 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 def testShouldBenchmarkBeScheduledOnMobileMobileTestDisabled(self): | 182 def testShouldBenchmarkBeScheduledOnMobileMobileTestDisabled(self): |
182 @decorators.Disabled('android') | 183 @decorators.Disabled('android') |
183 class bench(perf_benchmark.PerfBenchmark): | 184 class bench(perf_benchmark.PerfBenchmark): |
184 pass | 185 pass |
185 | 186 |
186 self.assertEqual( | 187 self.assertEqual( |
187 perf_data_generator.ShouldBenchmarkBeScheduled(bench(), 'android'), | 188 perf_data_generator.ShouldBenchmarkBeScheduled(bench(), 'android'), |
188 False) | 189 False) |
189 | 190 |
190 | 191 |
OLD | NEW |