Chromium Code Reviews| 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 import urllib |
| 9 | 9 |
| 10 class Test(object): | 10 class Test(object): |
| 11 """ | 11 """ |
| 12 Base class for tests that can be retried after deapplying a previously | 12 Base class for tests that can be retried after deapplying a previously |
| 13 applied patch. | 13 applied patch. |
| 14 """ | 14 """ |
| 15 | 15 |
| 16 def __init__(self): | 16 def __init__(self): |
| 17 super(Test, self).__init__() | 17 super(Test, self).__init__() |
| 18 self._test_runs = {} | 18 self._test_runs = {} |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 905 | 905 |
| 906 return True, gtest_results.failures | 906 return True, gtest_results.failures |
| 907 | 907 |
| 908 def post_run(self, api, suffix, test_filter=None): | 908 def post_run(self, api, suffix, test_filter=None): |
| 909 """Waits for launched test to finish and collects the results.""" | 909 """Waits for launched test to finish and collects the results.""" |
| 910 try: | 910 try: |
| 911 super(SwarmingGTestTest, self).post_run( | 911 super(SwarmingGTestTest, self).post_run( |
| 912 api, suffix,test_filter=test_filter) | 912 api, suffix,test_filter=test_filter) |
| 913 finally: | 913 finally: |
| 914 step_result = api.step.active_result | 914 step_result = api.step.active_result |
| 915 | |
| 916 # If Android swarming tasks, create link for unified logcats | |
| 917 # https://crbug.com/448050 | |
| 918 if api.chromium.c.TARGET_PLATFORM == 'android': | |
| 919 for task in self._tasks.values(): | |
| 920 if hasattr(task, 'trigger_output') and 'tasks' in task.trigger_output: | |
|
martiniss
2016/08/04 00:44:09
If we don't have this, what do we do? Is it an err
nicholaslin
2016/08/04 19:28:51
Added in an additional check to make sure the logd
| |
| 921 for test in task.trigger_output['tasks'].values(): | |
| 922 task_id = test.get('task_id') | |
| 923 shard_index = test.get('shard_index') | |
| 924 if shard_index is not None and task_id is not None: | |
| 925 prefix = 'https://luci-logdog.appspot.com/v/?s=' | |
| 926 suffix = '%s/%s/%s/%s/+/%s' % ('android', 'swarming', 'logcats', | |
| 927 task_id, 'unified_logcats') | |
| 928 step_result.presentation.links[('shard_index: %d logcats' % | |
| 929 shard_index)] = ( | |
| 930 prefix + urllib.quote_plus(suffix)) | |
| 931 | |
| 915 # Only upload test results if we have gtest results. | 932 # Only upload test results if we have gtest results. |
| 916 if (self._upload_test_results and | 933 if (self._upload_test_results and |
| 917 hasattr(step_result, 'test_utils') and | 934 hasattr(step_result, 'test_utils') and |
| 918 hasattr(step_result.test_utils, 'gtest_results')): | 935 hasattr(step_result.test_utils, 'gtest_results')): |
| 919 gtest_results = getattr(step_result.test_utils, 'gtest_results', None) | 936 gtest_results = getattr(step_result.test_utils, 'gtest_results', None) |
| 920 if gtest_results and gtest_results.raw: | 937 if gtest_results and gtest_results.raw: |
| 921 parsed_gtest_data = gtest_results.raw | 938 parsed_gtest_data = gtest_results.raw |
| 922 chrome_revision_cp = api.bot_update.last_returned_properties.get( | 939 chrome_revision_cp = api.bot_update.last_returned_properties.get( |
| 923 'got_revision_cp', 'x@{#0}') | 940 'got_revision_cp', 'x@{#0}') |
| 924 chrome_revision = str(api.commit_position.parse_revision( | 941 chrome_revision = str(api.commit_position.parse_revision( |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1744 args=args) | 1761 args=args) |
| 1745 api.gsutil.upload( | 1762 api.gsutil.upload( |
| 1746 temp_output_dir.join( | 1763 temp_output_dir.join( |
| 1747 '%s-android-chrome.json' % timestamp_string), | 1764 '%s-android-chrome.json' % timestamp_string), |
| 1748 'chromium-annotated-tests', 'android') | 1765 'chromium-annotated-tests', 'android') |
| 1749 | 1766 |
| 1750 GOMA_TESTS = [ | 1767 GOMA_TESTS = [ |
| 1751 GTestTest('base_unittests'), | 1768 GTestTest('base_unittests'), |
| 1752 GTestTest('content_unittests'), | 1769 GTestTest('content_unittests'), |
| 1753 ] | 1770 ] |
| OLD | NEW |