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

Side by Side Diff: scripts/slave/unittests/results_dashboard_test.py

Issue 2346963003: Updating perf recipe for disabled chartjson data. (Closed)
Patch Set: responding to review comments Created 4 years, 2 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 | « scripts/slave/runtest.py ('k') | scripts/slave/unittests/runtest_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Test cases for results_dashboard.""" 6 """Test cases for results_dashboard."""
7 7
8 import datetime 8 import datetime
9 import json 9 import json
10 import os 10 import os
(...skipping 24 matching lines...) Expand all
35 super(ResultsDashboardFormatTest, self).setUp() 35 super(ResultsDashboardFormatTest, self).setUp()
36 self.mox = mox.Mox() 36 self.mox = mox.Mox()
37 self.maxDiff = None 37 self.maxDiff = None
38 os.environ['BUILDBOT_BUILDBOTURL'] = ( 38 os.environ['BUILDBOT_BUILDBOTURL'] = (
39 'http://build.chromium.org/p/my.master/') 39 'http://build.chromium.org/p/my.master/')
40 40
41 def tearDown(self): 41 def tearDown(self):
42 self.mox.UnsetStubs() 42 self.mox.UnsetStubs()
43 43
44 def test_MakeDashboardJsonV1(self): 44 def test_MakeDashboardJsonV1(self):
45 self.internal_Test_MakeDashboardJsonV1()
46
47 def test_MakeDashboardJsonV1WithDisabledBenchmark(self):
48 self.internal_Test_MakeDashboardJsonV1(False)
49
50 def internal_Test_MakeDashboardJsonV1(self, enabled=True):
45 self.mox.StubOutWithMock(slave_utils, 'GetActiveMaster') 51 self.mox.StubOutWithMock(slave_utils, 'GetActiveMaster')
46 slave_utils.GetActiveMaster().AndReturn('ChromiumPerf') 52 slave_utils.GetActiveMaster().AndReturn('ChromiumPerf')
47 self.mox.StubOutWithMock(results_dashboard, '_GetTimestamp') 53 self.mox.StubOutWithMock(results_dashboard, '_GetTimestamp')
48 # pylint: disable=W0212 54 # pylint: disable=W0212
49 results_dashboard._GetTimestamp().AndReturn(307226) 55 results_dashboard._GetTimestamp().AndReturn(307226)
50 results_dashboard._GetTimestamp().AndReturn(307226) 56 results_dashboard._GetTimestamp().AndReturn(307226)
51 self.mox.ReplayAll() 57 self.mox.ReplayAll()
52 58
53 v1json = results_dashboard.MakeDashboardJsonV1( 59 v1json = results_dashboard.MakeDashboardJsonV1(
54 {'some_json': 'from_telemetry'}, 60 {'some_json': 'from_telemetry', 'enabled': enabled},
55 { 61 {
56 'rev': 'f46bf3c', 62 'rev': 'f46bf3c',
57 'git_revision': 'f46bf3c', 63 'git_revision': 'f46bf3c',
58 'v8_rev': '73a34f', 64 'v8_rev': '73a34f',
59 'commit_pos': 307226 65 'commit_pos': 307226
60 }, 66 },
61 'foo_test', 67 'foo_test',
62 'my-bot', 68 'my-bot',
63 'Builder', 69 'Builder',
64 '10', 70 '10',
65 {'a_annotation': 'xyz', 'r_my_rev': '789abc01'}, 71 {'a_annotation': 'xyz', 'r_my_rev': '789abc01'},
66 True) 72 True)
67 self.assertEqual( 73 self.assertEqual(
68 { 74 {
69 'master': 'ChromiumPerf', 75 'master': 'ChromiumPerf',
70 'bot': 'my-bot', 76 'bot': 'my-bot',
71 'chart_data': {'some_json': 'from_telemetry'}, 77 'chart_data': {'some_json': 'from_telemetry', 'enabled': enabled},
72 'is_ref': True, 78 'is_ref': True,
73 'test_suite_name': 'foo_test', 79 'test_suite_name': 'foo_test',
74 'point_id': 307226, 80 'point_id': 307226,
75 'supplemental': { 81 'supplemental': {
76 'annotation': 'xyz', 82 'annotation': 'xyz',
77 'a_stdio_uri': ('[Buildbot stdio](http://build.chromium.org/p' 83 'a_stdio_uri': ('[Buildbot stdio](http://build.chromium.org/p'
78 '/my.master/builders/Builder/builds/10/steps/' 84 '/my.master/builders/Builder/builds/10/steps/'
79 'foo_test/logs/stdio)') 85 'foo_test/logs/stdio)')
80 }, 86 },
81 'versions': { 87 'versions': {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 'revision': 1234, 409 'revision': 1234,
404 'value': 10, 410 'value': 10,
405 }])) 411 }]))
406 412
407 def test_LinkAnnotation_UnexpectedData(self): 413 def test_LinkAnnotation_UnexpectedData(self):
408 self.assertIsNone(results_dashboard._LinkAnnotation('', {})) 414 self.assertIsNone(results_dashboard._LinkAnnotation('', {}))
409 415
410 416
411 if __name__ == '__main__': 417 if __name__ == '__main__':
412 unittest.main() 418 unittest.main()
OLDNEW
« no previous file with comments | « scripts/slave/runtest.py ('k') | scripts/slave/unittests/runtest_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698