OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 4 |
5 import datetime | 5 import datetime |
6 import re | 6 import re |
7 import string | 7 import string |
8 | 8 |
9 | 9 |
10 class Test(object): | 10 class Test(object): |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 **kwargs) | 1280 **kwargs) |
1281 | 1281 |
1282 @staticmethod | 1282 @staticmethod |
1283 def compile_targets(api): | 1283 def compile_targets(api): |
1284 return ['browser_tests', 'blink_tests'] | 1284 return ['browser_tests', 'blink_tests'] |
1285 | 1285 |
1286 | 1286 |
1287 class BisectTest(Test): # pylint: disable=W0232 | 1287 class BisectTest(Test): # pylint: disable=W0232 |
1288 name = 'bisect_test' | 1288 name = 'bisect_test' |
1289 | 1289 |
1290 def __init__(self, test_parameters={}): | 1290 def __init__(self, test_parameters={}, **kwargs): |
1291 super(BisectTest, self).__init__() | 1291 super(BisectTest, self).__init__() |
1292 self._test_parameters = test_parameters | 1292 self._test_parameters = test_parameters |
| 1293 self.run_results = {} |
| 1294 self.kwargs = kwargs |
1293 | 1295 |
1294 @property | 1296 @property |
1295 def abort_on_failure(self): | 1297 def abort_on_failure(self): |
1296 return True # pragma: no cover | 1298 return True # pragma: no cover |
1297 | 1299 |
1298 @property | 1300 @property |
1299 def uses_local_devices(self): | 1301 def uses_local_devices(self): |
1300 return False | 1302 return False |
1301 | 1303 |
1302 @staticmethod | 1304 @staticmethod |
1303 def compile_targets(_): # pragma: no cover | 1305 def compile_targets(_): # pragma: no cover |
1304 return ['chrome'] # Bisect always uses a separate bot for building. | 1306 return ['chrome'] # Bisect always uses a separate bot for building. |
1305 | 1307 |
1306 def pre_run(self, api, _, test_filter=None): | 1308 def pre_run(self, api, _, test_filter=None): |
1307 self.test_config = api.bisect_tester.load_config_from_dict( | 1309 self.test_config = api.bisect_tester.load_config_from_dict( |
1308 self._test_parameters.get('bisect_config', | 1310 self._test_parameters.get('bisect_config', |
1309 api.properties.get('bisect_config'))) | 1311 api.properties.get('bisect_config'))) |
1310 | 1312 |
1311 def run(self, api, _, test_filter=None): | 1313 def run(self, api, _, test_filter=None): |
1312 self._run_results, self.test_output, self.retcodes = ( | 1314 self.run_results = api.bisect_tester.run_test(self.test_config, |
1313 api.bisect_tester.run_test(self.test_config)) | 1315 **self.kwargs) |
1314 | |
1315 def post_run(self, api, _, test_filter=None): | |
1316 self.values = api.bisect_tester.digest_run_results( | |
1317 self._run_results, self.retcodes, self.test_config) | |
1318 api.bisect_tester.upload_results(self.test_output, self.values, | |
1319 self.retcodes, self._test_parameters) | |
1320 | 1316 |
1321 def has_valid_results(self, *_): | 1317 def has_valid_results(self, *_): |
1322 return len(getattr(self, 'values', [])) > 0 # pragma: no cover | 1318 return bool(self.run_results.get('retcodes')) # pragma: no cover |
1323 | 1319 |
1324 def failures(self, *_): | 1320 def failures(self, *_): |
1325 return self._failures # pragma: no cover | 1321 return self._failures # pragma: no cover |
1326 | 1322 |
1327 | 1323 |
1328 class AndroidTest(Test): | 1324 class AndroidTest(Test): |
1329 def __init__(self, name, compile_targets, isolate_file_path=None): | 1325 def __init__(self, name, compile_targets, isolate_file_path=None): |
1330 super(AndroidTest, self).__init__() | 1326 super(AndroidTest, self).__init__() |
1331 | 1327 |
1332 self._name = name | 1328 self._name = name |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 args=args) | 1740 args=args) |
1745 api.gsutil.upload( | 1741 api.gsutil.upload( |
1746 temp_output_dir.join( | 1742 temp_output_dir.join( |
1747 '%s-android-chrome.json' % timestamp_string), | 1743 '%s-android-chrome.json' % timestamp_string), |
1748 'chromium-annotated-tests', 'android') | 1744 'chromium-annotated-tests', 'android') |
1749 | 1745 |
1750 GOMA_TESTS = [ | 1746 GOMA_TESTS = [ |
1751 GTestTest('base_unittests'), | 1747 GTestTest('base_unittests'), |
1752 GTestTest('content_unittests'), | 1748 GTestTest('content_unittests'), |
1753 ] | 1749 ] |
OLD | NEW |