Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: scripts/slave/recipe_modules/chromium_tests/steps.py

Issue 2207263002: Add logcats link in builbot page for android swarming tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Update hash, add check for logdog Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
ghost stip (do not use) 2016/08/04 23:55:58 I wonder if there is a way to make this more gener
nicholaslin 2016/08/05 00:27:17 Perhaps. Maybe not a link template but maybe a log
917 # https://crbug.com/448050
918 if api.chromium.c.TARGET_PLATFORM == 'android':
919 for task in self._tasks.values():
920 includes_logdog = False
921 if hasattr(task, 'cipd_packages'):
922 func = lambda x: 'logdog/butler' in x[1]
923 includes_logdog = filter(func, task.cipd_packages)
924 if (includes_logdog and hasattr(task, 'trigger_output')
925 and 'tasks' in task.trigger_output):
926 for test in task.trigger_output['tasks'].values():
927 task_id = test.get('task_id')
928 shard_index = test.get('shard_index')
929 if shard_index is not None and task_id is not None:
930 prefix = 'https://luci-logdog.appspot.com/v/?s='
931 suffix = '%s/%s/%s/%s/+/%s' % ('android', 'swarming', 'logcats',
932 task_id, 'unified_logcats')
933 step_result.presentation.links[('shard_index: %d logcats' %
934 shard_index)] = (
935 prefix + urllib.quote_plus(suffix))
936
915 # Only upload test results if we have gtest results. 937 # Only upload test results if we have gtest results.
916 if (self._upload_test_results and 938 if (self._upload_test_results and
917 hasattr(step_result, 'test_utils') and 939 hasattr(step_result, 'test_utils') and
918 hasattr(step_result.test_utils, 'gtest_results')): 940 hasattr(step_result.test_utils, 'gtest_results')):
919 gtest_results = getattr(step_result.test_utils, 'gtest_results', None) 941 gtest_results = getattr(step_result.test_utils, 'gtest_results', None)
920 if gtest_results and gtest_results.raw: 942 if gtest_results and gtest_results.raw:
921 parsed_gtest_data = gtest_results.raw 943 parsed_gtest_data = gtest_results.raw
922 chrome_revision_cp = api.bot_update.last_returned_properties.get( 944 chrome_revision_cp = api.bot_update.last_returned_properties.get(
923 'got_revision_cp', 'x@{#0}') 945 'got_revision_cp', 'x@{#0}')
924 chrome_revision = str(api.commit_position.parse_revision( 946 chrome_revision = str(api.commit_position.parse_revision(
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1744 args=args) 1766 args=args)
1745 api.gsutil.upload( 1767 api.gsutil.upload(
1746 temp_output_dir.join( 1768 temp_output_dir.join(
1747 '%s-android-chrome.json' % timestamp_string), 1769 '%s-android-chrome.json' % timestamp_string),
1748 'chromium-annotated-tests', 'android') 1770 'chromium-annotated-tests', 'android')
1749 1771
1750 GOMA_TESTS = [ 1772 GOMA_TESTS = [
1751 GTestTest('base_unittests'), 1773 GTestTest('base_unittests'),
1752 GTestTest('content_unittests'), 1774 GTestTest('content_unittests'),
1753 ] 1775 ]
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698