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 json | 6 import json |
7 import re | 7 import re |
8 import string | 8 import string |
9 | 9 |
10 | 10 |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 self._run_results, self.retcodes, self.test_config) | 1416 self._run_results, self.retcodes, self.test_config) |
1417 api.bisect_tester.upload_results(self.test_output, self.values, | 1417 api.bisect_tester.upload_results(self.test_output, self.values, |
1418 self.retcodes, self._test_parameters) | 1418 self.retcodes, self._test_parameters) |
1419 | 1419 |
1420 def has_valid_results(self, *_): | 1420 def has_valid_results(self, *_): |
1421 return len(getattr(self, 'values', [])) > 0 # pragma: no cover | 1421 return len(getattr(self, 'values', [])) > 0 # pragma: no cover |
1422 | 1422 |
1423 def failures(self, *_): | 1423 def failures(self, *_): |
1424 return self._failures # pragma: no cover | 1424 return self._failures # pragma: no cover |
1425 | 1425 |
1426 class BisectTestStaging(BisectTest): | 1426 |
| 1427 class BisectTestStaging(Test): # pylint: disable=W0232 |
| 1428 name = 'bisect_test_staging' |
| 1429 |
| 1430 def __init__(self, test_parameters={}, **kwargs): |
| 1431 super(BisectTestStaging, self).__init__() |
| 1432 self._test_parameters = test_parameters |
| 1433 self.run_results = {} |
| 1434 self.kwargs = kwargs |
| 1435 |
| 1436 @property |
| 1437 def abort_on_failure(self): |
| 1438 return True # pragma: no cover |
| 1439 |
| 1440 @property |
| 1441 def uses_local_devices(self): |
| 1442 return False |
| 1443 |
| 1444 @staticmethod |
| 1445 def compile_targets(_): # pragma: no cover |
| 1446 return ['chrome'] # Bisect always uses a separate bot for building. |
| 1447 |
1427 def pre_run(self, api, _, test_filter=None): | 1448 def pre_run(self, api, _, test_filter=None): |
1428 self.test_config = api.bisect_tester_staging.load_config_from_dict( | 1449 self.test_config = api.bisect_tester_staging.load_config_from_dict( |
1429 self._test_parameters.get('bisect_config', | 1450 self._test_parameters.get('bisect_config', |
1430 api.properties.get('bisect_config'))) | 1451 api.properties.get('bisect_config'))) |
1431 | 1452 |
1432 def run(self, api, _, test_filter=None): | 1453 def run(self, api, _, test_filter=None): |
1433 self._run_results, self.test_output, self.retcodes = ( | 1454 self.run_results = api.bisect_tester_staging.run_test( |
1434 api.bisect_tester_staging.run_test(self.test_config)) | 1455 self.test_config, **self.kwargs) |
1435 | 1456 |
1436 def post_run(self, api, _, test_filter=None): | 1457 def has_valid_results(self, *_): |
1437 self.values = api.bisect_tester_staging.digest_run_results( | 1458 return bool(self.run_results.get('retcodes')) # pragma: no cover |
1438 self._run_results, self.retcodes, self.test_config) | 1459 |
1439 api.bisect_tester_staging.upload_results( | 1460 def failures(self, *_): |
1440 self.test_output, self.values, self.retcodes, self._test_parameters) | 1461 return self._failures # pragma: no cover |
1441 | 1462 |
1442 | 1463 |
1443 class AndroidTest(Test): | 1464 class AndroidTest(Test): |
1444 def __init__(self, name, compile_targets, isolate_file_path=None): | 1465 def __init__(self, name, compile_targets, isolate_file_path=None): |
1445 super(AndroidTest, self).__init__() | 1466 super(AndroidTest, self).__init__() |
1446 | 1467 |
1447 self._name = name | 1468 self._name = name |
1448 self._compile_targets = compile_targets | 1469 self._compile_targets = compile_targets |
1449 | 1470 |
1450 self.isolate_file_path = isolate_file_path | 1471 self.isolate_file_path = isolate_file_path |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 args=args) | 1885 args=args) |
1865 api.gsutil.upload( | 1886 api.gsutil.upload( |
1866 temp_output_dir.join( | 1887 temp_output_dir.join( |
1867 '%s-android-chrome.json' % timestamp_string), | 1888 '%s-android-chrome.json' % timestamp_string), |
1868 'chromium-annotated-tests', 'android') | 1889 'chromium-annotated-tests', 'android') |
1869 | 1890 |
1870 GOMA_TESTS = [ | 1891 GOMA_TESTS = [ |
1871 GTestTest('base_unittests'), | 1892 GTestTest('base_unittests'), |
1872 GTestTest('content_unittests'), | 1893 GTestTest('content_unittests'), |
1873 ] | 1894 ] |
OLD | NEW |