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