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

Unified 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 expectations 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/chromium_tests/steps.py
diff --git a/scripts/slave/recipe_modules/chromium_tests/steps.py b/scripts/slave/recipe_modules/chromium_tests/steps.py
index 3e55c4186348c49ea67187f583439ecf8c3f3cc8..d70bc1d649bd4bb44d0e1bb0fcf6b2cdaa0a5147 100644
--- a/scripts/slave/recipe_modules/chromium_tests/steps.py
+++ b/scripts/slave/recipe_modules/chromium_tests/steps.py
@@ -6,7 +6,6 @@ import datetime
import re
import string
-
class Test(object):
"""
Base class for tests that can be retried after deapplying a previously
@@ -441,6 +440,7 @@ def generate_gtest(api, chromium_tests_api, mastername, buildername, test_spec,
swarming_expiration = None
swarming_hard_timeout = None
cipd_packages = None
+ output_links = None
if enable_swarming:
swarming_spec = test.get('swarming', {})
if swarming_spec.get('can_use_on_swarming_builders'):
@@ -451,6 +451,7 @@ def generate_gtest(api, chromium_tests_api, mastername, buildername, test_spec,
swarming_expiration = swarming_spec.get('expiration')
swarming_hard_timeout = swarming_spec.get('hard_timeout')
packages = swarming_spec.get('cipd_packages')
+ output_links = swarming_spec.get('output_links')
if packages:
cipd_packages = [(p['location'],
p['cipd_package'],
@@ -478,7 +479,8 @@ def generate_gtest(api, chromium_tests_api, mastername, buildername, test_spec,
swarming_hard_timeout=swarming_hard_timeout,
override_compile_targets=override_compile_targets,
override_isolate_target=override_isolate_target,
- use_xvfb=use_xvfb, cipd_packages=cipd_packages)
+ use_xvfb=use_xvfb, cipd_packages=cipd_packages,
+ output_links=output_links)
else:
yield GTestTest(name, args=args, target_name=target_name,
flakiness_dash=True,
@@ -490,7 +492,8 @@ def generate_gtest(api, chromium_tests_api, mastername, buildername, test_spec,
swarming_hard_timeout=swarming_hard_timeout,
override_compile_targets=override_compile_targets,
override_isolate_target=override_isolate_target,
- use_xvfb=use_xvfb, cipd_packages=cipd_packages)
+ use_xvfb=use_xvfb, cipd_packages=cipd_packages,
+ output_links=output_links)
def generate_instrumentation_test(api, chromium_tests_api, mastername,
@@ -836,7 +839,7 @@ class SwarmingGTestTest(SwarmingTest):
dimensions=None, tags=None, extra_suffix=None, priority=None,
expiration=None, hard_timeout=None, upload_test_results=True,
override_compile_targets=None, override_isolate_target=None,
- cipd_packages=None):
+ cipd_packages=None, output_links=None):
super(SwarmingGTestTest, self).__init__(name, dimensions, tags, target_name,
extra_suffix, priority, expiration,
hard_timeout)
@@ -846,6 +849,7 @@ class SwarmingGTestTest(SwarmingTest):
self._override_compile_targets = override_compile_targets
self._override_isolate_target = override_isolate_target
self._cipd_packages = cipd_packages
+ self._output_links = output_links
def compile_targets(self, api):
# <X>_run target depends on <X>, and then isolates it invoking isolate.py.
@@ -912,6 +916,23 @@ class SwarmingGTestTest(SwarmingTest):
api, suffix,test_filter=test_filter)
finally:
step_result = api.step.active_result
+
+ # Populate additional swarming links on buildbot page
+ if self._output_links:
+ for task in self._tasks.values():
+ for test in task.trigger_output['tasks'].values():
+ task_id = test.get('task_id')
+ shard_index = str(test.get('shard_index'))
+ for output in self._output_links:
+ name = output['name']
+ link = output['link']
ghost stip (do not use) 2016/08/08 20:51:12 can you move this down so it's just above 931? tha
+ name = (name.replace('${SHARD_INDEX}', shard_index)).replace(
+ '${TASK_ID}', task_id)
+ link = ''.join(link)
ghost stip (do not use) 2016/08/08 20:51:12 put a comment here on why we're doing this
+ link = (link.replace('${SHARD_INDEX}', shard_index)).replace(
+ '${TASK_ID}', task_id)
+ step_result.presentation.links[name] = link
+
# Only upload test results if we have gtest results.
if (self._upload_test_results and
hasattr(step_result, 'test_utils') and
@@ -1155,14 +1176,14 @@ class GTestTest(Test):
swarming_shards=1, swarming_dimensions=None, swarming_tags=None,
swarming_extra_suffix=None, swarming_priority=None,
swarming_expiration=None, swarming_hard_timeout=None,
- cipd_packages=None, **runtest_kwargs):
+ cipd_packages=None, output_links=None, **runtest_kwargs):
super(GTestTest, self).__init__()
if enable_swarming:
self._test = SwarmingGTestTest(
name, args, target_name, swarming_shards, swarming_dimensions,
swarming_tags, swarming_extra_suffix, swarming_priority,
swarming_expiration, swarming_hard_timeout,
- cipd_packages=cipd_packages,
+ cipd_packages=cipd_packages, output_links=output_links,
override_compile_targets=runtest_kwargs.get(
'override_compile_targets'),
override_isolate_target=runtest_kwargs.get(
« 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