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

Side by Side Diff: tools/perf/core/perf_data_generator_unittest.py

Issue 2822723002: [Telemetry]Do not run power.idle_platform for reference build runs (Closed)
Patch Set: use telemetry benchmark class Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « tools/perf/core/perf_data_generator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_data_generator 6 from core import perf_data_generator
7 from core.perf_data_generator import BenchmarkMetadata 7 from core.perf_data_generator import BenchmarkMetadata
8 8
9 from telemetry import benchmark
10
9 11
10 class PerfDataGeneratorTest(unittest.TestCase): 12 class PerfDataGeneratorTest(unittest.TestCase):
11 def setUp(self): 13 def setUp(self):
12 # Test config can be big, so set maxDiff to None to see the full comparision 14 # Test config can be big, so set maxDiff to None to see the full comparision
13 # diff when assertEquals fails. 15 # diff when assertEquals fails.
14 self.maxDiff = None 16 self.maxDiff = None
15 17
16 def testVerifyAllTestsInBenchmarkCsvPassesWithCorrectInput(self): 18 def testVerifyAllTestsInBenchmarkCsvPassesWithCorrectInput(self):
17 tests = { 19 tests = {
18 'AAAAA1 AUTOGENERATED': {}, 20 'AAAAA1 AUTOGENERATED': {},
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 'dimension_sets': [{'os': 'SkyNet', 'id': 'T-850', 'pool': 'T-RIP'}], 106 'dimension_sets': [{'os': 'SkyNet', 'id': 'T-850', 'pool': 'T-RIP'}],
105 'hard_timeout': 7200, 107 'hard_timeout': 7200,
106 'can_use_on_swarming_builders': True, 108 'can_use_on_swarming_builders': True,
107 'expiration': 36000, 109 'expiration': 36000,
108 'io_timeout': 3600, 110 'io_timeout': 3600,
109 }, 111 },
110 'name': 'speedometer.reference', 112 'name': 'speedometer.reference',
111 'isolate_name': 'telemetry_perf_tests', 113 'isolate_name': 'telemetry_perf_tests',
112 } 114 }
113 self.assertEquals(test, expected_generated_test) 115 self.assertEquals(test, expected_generated_test)
116
117 def testGenerateTelemetryTestsBlacklistedReferenceBuildTest(self):
118 class BlacklistedBenchmark(benchmark.Benchmark):
119 @classmethod
120 def Name(cls):
121 return 'blacklisted'
122
123 class NotBlacklistedBenchmark(benchmark.Benchmark):
124 @classmethod
125 def Name(cls):
126 return 'not_blacklisted'
127
128 swarming_dimensions = [
129 {'os': 'SkyNet', 'id': 'T-850', 'pool': 'T-RIP', 'device_ids': ['a']}
130 ]
131 test_config = {
132 'platform': 'android',
133 'swarming_dimensions': swarming_dimensions,
134 }
135 benchmarks = [BlacklistedBenchmark, NotBlacklistedBenchmark]
136 tests = perf_data_generator.generate_telemetry_tests(
137 test_config, benchmarks, None, False, ['blacklisted'])
138
139 generated_test_names = set(t['name'] for t in tests)
140 self.assertEquals(
141 generated_test_names,
142 {'blacklisted', 'not_blacklisted', 'not_blacklisted.reference'})
OLDNEW
« no previous file with comments | « tools/perf/core/perf_data_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698