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

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

Issue 2973733002: Enable loading.desktop benchmark with network service enabled on perf fyi bot. (Closed)
Patch Set: . Created 3 years, 5 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_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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 }] 268 }]
269 }, 269 },
270 'name': 'test', 270 'name': 'test',
271 }] 271 }]
272 self.assertEqual( 272 self.assertEqual(
273 perf_data_generator.remove_blacklisted_device_tests( 273 perf_data_generator.remove_blacklisted_device_tests(
274 tests, ['build1-b1', 'build2-b1']), ([], { 274 tests, ['build1-b1', 'build2-b1']), ([], {
275 'build1-b1': ['test'], 275 'build1-b1': ['test'],
276 'build2-b1': ['other_test', 'test'], 276 'build2-b1': ['other_test', 'test'],
277 })) 277 }))
278
279 def testExtraTestsAreLoadedFromFile(self):
280 tests = {
281 'Linux Perf': {}
282 }
283
284 mock_extras_json = '''
285 {
286 "comment": [ "This is comment and therefore should be skipped." ],
287 "Mojo Linux Perf": {}
288 }
289 '''
290
291 mock_waterfall_name = 'hello'
292
293 def mockIsFile(path):
294 return path.endswith('%s.extras.json' % mock_waterfall_name)
295
296 with mock.patch('os.path.isfile', side_effect=mockIsFile):
297 with mock.patch('__builtin__.open',
298 mock.mock_open(read_data=mock_extras_json)):
299 perf_data_generator.append_extra_tests({'name': mock_waterfall_name},
300 tests)
301
302 self.assertTrue('Linux Perf' in tests)
303 self.assertTrue('Mojo Linux Perf' in tests)
304 self.assertFalse('comment' in tests)
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