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

Unified Diff: scripts/slave/recipe_modules/bot_update/api.py

Issue 476503002: Re-land r289084 - "Make telemetry*_unittests upload to test-results.appspot.com" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: tweak how we set bot_update.properties Created 6 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/recipe_modules/chromium/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/bot_update/api.py
diff --git a/scripts/slave/recipe_modules/bot_update/api.py b/scripts/slave/recipe_modules/bot_update/api.py
index 60059009073dcb2d90f5c50f5c2bfae64c6a85b8..60a59ebe25e033f9896428f75f513c996b2d72fa 100644
--- a/scripts/slave/recipe_modules/bot_update/api.py
+++ b/scripts/slave/recipe_modules/bot_update/api.py
@@ -48,6 +48,10 @@ def jsonish_to_python(spec, is_top=False):
class BotUpdateApi(recipe_api.RecipeApi):
+ def __init__(self, *args, **kwargs):
+ self._properties = {}
+ super(BotUpdateApi, self).__init__(*args, **kwargs)
+
def __call__(self, name, cmd, **kwargs):
"""Wrapper for easy calling of bot_update."""
assert isinstance(cmd, (list, tuple))
@@ -55,6 +59,10 @@ class BotUpdateApi(recipe_api.RecipeApi):
'scripts', 'slave', 'bot_update.py')
return self.m.python(name, bot_update_path, cmd, **kwargs)
+ @property
+ def properties(self):
+ return self._properties
+
def ensure_checkout(self, gclient_config=None, suffix=None,
patch=True, update_presentation=True,
force=False, patch_root=None, no_shallow=False,
@@ -158,12 +166,12 @@ class BotUpdateApi(recipe_api.RecipeApi):
finally:
step_result = self.m.step.active_result
+ self._properties = step_result.json.output.get('properties', {})
+
if update_presentation:
# Set properties such as got_revision.
- if 'properties' in step_result.json.output:
- properties = step_result.json.output['properties']
- for prop_name, prop_value in properties.iteritems():
- step_result.presentation.properties[prop_name] = prop_value
+ for prop_name, prop_value in self.properties.iteritems():
+ step_result.presentation.properties[prop_name] = prop_value
# Add helpful step description in the step UI.
if 'step_text' in step_result.json.output:
step_text = step_result.json.output['step_text']
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698