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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/core/perf_data_generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/core/perf_data_generator_unittest.py
diff --git a/tools/perf/core/perf_data_generator_unittest.py b/tools/perf/core/perf_data_generator_unittest.py
index 6240d16085cece36895eab0cafc77a3115609ab2..786e3fe332ebac63d48b4edc575e4bb8da73b462 100644
--- a/tools/perf/core/perf_data_generator_unittest.py
+++ b/tools/perf/core/perf_data_generator_unittest.py
@@ -275,3 +275,30 @@ class PerfDataGeneratorTest(unittest.TestCase):
'build1-b1': ['test'],
'build2-b1': ['other_test', 'test'],
}))
+
+ def testExtraTestsAreLoadedFromFile(self):
+ tests = {
+ 'Linux Perf': {}
+ }
+
+ mock_extras_json = '''
+ {
+ "comment": [ "This is comment and therefore should be skipped." ],
+ "Mojo Linux Perf": {}
+ }
+ '''
+
+ mock_waterfall_name = 'hello'
+
+ def mockIsFile(path):
+ return path.endswith('%s.extras.json' % mock_waterfall_name)
+
+ with mock.patch('os.path.isfile', side_effect=mockIsFile):
+ with mock.patch('__builtin__.open',
+ mock.mock_open(read_data=mock_extras_json)):
+ perf_data_generator.append_extra_tests({'name': mock_waterfall_name},
+ tests)
+
+ self.assertTrue('Linux Perf' in tests)
+ self.assertTrue('Mojo Linux Perf' in tests)
+ self.assertFalse('comment' in tests)
« 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