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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 | 344 |
345 if hasattr(step_result, 'test_utils'): | 345 if hasattr(step_result, 'test_utils'): |
346 r = step_result.test_utils.gtest_results | 346 r = step_result.test_utils.gtest_results |
347 p = step_result.presentation | 347 p = step_result.presentation |
348 | 348 |
349 if r.valid: | 349 if r.valid: |
350 p.step_text += api.test_utils.format_step_text([ | 350 p.step_text += api.test_utils.format_step_text([ |
351 ['failures:', r.failures] | 351 ['failures:', r.failures] |
352 ]) | 352 ]) |
353 | 353 |
354 if api.test_results.c.test_results_server: | |
355 api.test_results.upload( | |
356 api.json.input(r.raw), | |
357 test_type=self.name, | |
358 chrome_revision=api.bot_update.last_returned_properties.get( | |
359 'got_revision_cp', 'x@{#0}')) | |
Dirk Pranke
2016/08/11 00:11:53
should we just accept the exception here if the ke
jbudorick
2016/08/11 02:45:48
I'm not sure, but this is what we're doing in the
| |
360 | |
361 | |
354 return step_result | 362 return step_result |
355 | 363 |
356 def has_valid_results(self, api, suffix): | 364 def has_valid_results(self, api, suffix): |
357 if suffix not in self._test_runs: | 365 if suffix not in self._test_runs: |
358 return False # pragma: no cover | 366 return False # pragma: no cover |
359 if not hasattr(self._test_runs[suffix], 'test_utils'): | 367 if not hasattr(self._test_runs[suffix], 'test_utils'): |
360 return False # pragma: no cover | 368 return False # pragma: no cover |
361 gtest_results = self._test_runs[suffix].test_utils.gtest_results | 369 gtest_results = self._test_runs[suffix].test_utils.gtest_results |
362 if not gtest_results.valid: # pragma: no cover | 370 if not gtest_results.valid: # pragma: no cover |
363 return False | 371 return False |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
906 finally: | 914 finally: |
907 step_result = api.step.active_result | 915 step_result = api.step.active_result |
908 # Only upload test results if we have gtest results. | 916 # Only upload test results if we have gtest results. |
909 if (self._upload_test_results and | 917 if (self._upload_test_results and |
910 hasattr(step_result, 'test_utils') and | 918 hasattr(step_result, 'test_utils') and |
911 hasattr(step_result.test_utils, 'gtest_results')): | 919 hasattr(step_result.test_utils, 'gtest_results')): |
912 gtest_results = getattr(step_result.test_utils, 'gtest_results', None) | 920 gtest_results = getattr(step_result.test_utils, 'gtest_results', None) |
913 if gtest_results and gtest_results.raw: | 921 if gtest_results and gtest_results.raw: |
914 parsed_gtest_data = gtest_results.raw | 922 parsed_gtest_data = gtest_results.raw |
915 chrome_revision_cp = api.bot_update.last_returned_properties.get( | 923 chrome_revision_cp = api.bot_update.last_returned_properties.get( |
916 'got_revision_cp', 'x@{#0}') | 924 'got_revision_cp', 'x@{#0}') |
jbudorick
2016/08/11 02:45:48
i.e., here
| |
917 chrome_revision = str(api.commit_position.parse_revision( | 925 chrome_revision = str(api.commit_position.parse_revision( |
918 chrome_revision_cp)) | 926 chrome_revision_cp)) |
919 api.test_results.upload( | 927 api.test_results.upload( |
920 api.json.input(parsed_gtest_data), | 928 api.json.input(parsed_gtest_data), |
921 chrome_revision=chrome_revision, | 929 chrome_revision=chrome_revision, |
922 test_type=step_result.step['name'], | 930 test_type=step_result.step['name'], |
923 test_results_server='test-results.appspot.com') | 931 test_results_server='test-results.appspot.com') |
924 | 932 |
925 | 933 |
926 class LocalIsolatedScriptTest(Test): | 934 class LocalIsolatedScriptTest(Test): |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1355 | 1363 |
1356 failures = gtest_results.failures | 1364 failures = gtest_results.failures |
1357 self._test_runs[suffix] = {'valid': True, 'failures': failures} | 1365 self._test_runs[suffix] = {'valid': True, 'failures': failures} |
1358 step_result.presentation.step_text += ( | 1366 step_result.presentation.step_text += ( |
1359 api.test_utils.format_step_text([['failures:', failures]])) | 1367 api.test_utils.format_step_text([['failures:', failures]])) |
1360 | 1368 |
1361 api.test_results.upload( | 1369 api.test_results.upload( |
1362 api.json.input(gtest_results.raw), | 1370 api.json.input(gtest_results.raw), |
1363 test_type=self.name, | 1371 test_type=self.name, |
1364 chrome_revision=api.bot_update.last_returned_properties.get( | 1372 chrome_revision=api.bot_update.last_returned_properties.get( |
1365 'got_revision_cp', 'x@{#0}'), | 1373 'got_revision_cp', 'x@{#0}'), |
jbudorick
2016/08/11 02:45:47
and here
| |
1366 test_results_server='test-results.appspot.com') | 1374 test_results_server='test-results.appspot.com') |
1367 | 1375 |
1368 def compile_targets(self, _): | 1376 def compile_targets(self, _): |
1369 return self._compile_targets | 1377 return self._compile_targets |
1370 | 1378 |
1371 def has_valid_results(self, api, suffix): | 1379 def has_valid_results(self, api, suffix): |
1372 if suffix not in self._test_runs: | 1380 if suffix not in self._test_runs: |
1373 return False # pragma: no cover | 1381 return False # pragma: no cover |
1374 return self._test_runs[suffix]['valid'] | 1382 return self._test_runs[suffix]['valid'] |
1375 | 1383 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1737 args=args) | 1745 args=args) |
1738 api.gsutil.upload( | 1746 api.gsutil.upload( |
1739 temp_output_dir.join( | 1747 temp_output_dir.join( |
1740 '%s-android-chrome.json' % timestamp_string), | 1748 '%s-android-chrome.json' % timestamp_string), |
1741 'chromium-annotated-tests', 'android') | 1749 'chromium-annotated-tests', 'android') |
1742 | 1750 |
1743 GOMA_TESTS = [ | 1751 GOMA_TESTS = [ |
1744 GTestTest('base_unittests'), | 1752 GTestTest('base_unittests'), |
1745 GTestTest('content_unittests'), | 1753 GTestTest('content_unittests'), |
1746 ] | 1754 ] |
OLD | NEW |