| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 argparse | 4 import argparse |
| 5 import logging | 5 import logging |
| 6 import json | 6 import json |
| 7 import StringIO | 7 import StringIO |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 import mock | 10 import mock |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 def testConstructorTrybotAllWin(self): | 174 def testConstructorTrybotAllWin(self): |
| 175 self._MockTryserverJson({ | 175 self._MockTryserverJson({ |
| 176 'android_nexus4_perf_bisect': 'stuff', | 176 'android_nexus4_perf_bisect': 'stuff', |
| 177 'android_nexus5_perf_bisect': 'stuff2', | 177 'android_nexus5_perf_bisect': 'stuff2', |
| 178 'win_8_perf_bisect': 'otherstuff', | 178 'win_8_perf_bisect': 'otherstuff', |
| 179 'win_perf_bisect': 'otherstuff2', | 179 'win_perf_bisect': 'otherstuff2', |
| 180 'linux_perf_bisect': 'otherstuff3', | 180 'linux_perf_bisect': 'otherstuff3', |
| 181 'win_x64_perf_bisect': 'otherstuff4', | 181 'win_x64_perf_bisect': 'otherstuff4', |
| 182 'win_perf_bisect_builder': 'not a trybot', | 182 'win_perf_bisect_builder': 'not a trybot', |
| 183 'win_x64_10_perf_bisect': 'otherstuff4', |
| 184 'winx64ati_perf_bisect': 'not a trybot', |
| 185 'winx64nvidia_perf_bisect': 'not a trybot', |
| 183 }) | 186 }) |
| 184 command = trybot_command.Trybot() | 187 command = trybot_command.Trybot() |
| 185 command._InitializeBuilderNames('all-win') | 188 command._InitializeBuilderNames('all-win') |
| 186 self.assertEquals( | 189 self.assertEquals( |
| 187 ['win', 'win-x64'], | 190 ['win', 'win-x64'], |
| 188 sorted(command._builder_names)) | 191 sorted(command._builder_names)) |
| 189 self.assertEquals( | 192 self.assertEquals( |
| 190 ['win_8_perf_bisect', 'win_perf_bisect'], | 193 ['win_8_perf_bisect', 'win_perf_bisect'], |
| 191 sorted(command._builder_names.get('win'))) | 194 sorted(command._builder_names.get('win'))) |
| 195 self.assertNotIn( |
| 196 'win_x64_perf_bisect', |
| 197 sorted(command._builder_names.get('win'))) |
| 192 self.assertEquals( | 198 self.assertEquals( |
| 193 ['win_x64_perf_bisect'], sorted(command._builder_names.get('win-x64'))) | 199 sorted(['win_x64_perf_bisect', 'win_x64_10_perf_bisect', |
| 200 'winx64ati_perf_bisect', 'winx64nvidia_perf_bisect']), |
| 201 sorted(command._builder_names.get('win-x64'))) |
| 194 | 202 |
| 195 def testConstructorTrybotAllAndroid(self): | 203 def testConstructorTrybotAllAndroid(self): |
| 196 self._MockTryserverJson({ | 204 self._MockTryserverJson({ |
| 197 'android_nexus4_perf_bisect': 'stuff', | 205 'android_nexus4_perf_bisect': 'stuff', |
| 198 'android_nexus5_perf_bisect': 'stuff2', | 206 'android_nexus5_perf_bisect': 'stuff2', |
| 199 'win_8_perf_bisect': 'otherstuff', | 207 'win_8_perf_bisect': 'otherstuff', |
| 200 'win_perf_bisect': 'otherstuff2', | 208 'win_perf_bisect': 'otherstuff2', |
| 201 'linux_perf_bisect': 'otherstuff3', | 209 'linux_perf_bisect': 'otherstuff3', |
| 202 'win_x64_perf_bisect': 'otherstuff4', | 210 'win_x64_perf_bisect': 'otherstuff4', |
| 203 'win_perf_bisect_builder': 'not a trybot', | 211 'win_perf_bisect_builder': 'not a trybot', |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 "target_arch": "ia32", | 616 "target_arch": "ia32", |
| 609 "truncate_percent": "0" | 617 "truncate_percent": "0" |
| 610 }''''''config = { | 618 }''''''config = { |
| 611 "command": "./tools/perf/run_benchmark --browser=android-chromium --verbose", | 619 "command": "./tools/perf/run_benchmark --browser=android-chromium --verbose", |
| 612 "max_time_minutes": "120", | 620 "max_time_minutes": "120", |
| 613 "repeat_count": "1", | 621 "repeat_count": "1", |
| 614 "target_arch": "ia32", | 622 "target_arch": "ia32", |
| 615 "truncate_percent": "0" | 623 "truncate_percent": "0" |
| 616 }''') | 624 }''') |
| 617 self.assertEquals(cfg.read(), config) | 625 self.assertEquals(cfg.read(), config) |
| OLD | NEW |