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