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

Unified Diff: infra/bots/recipe_modules/vars/api.py

Issue 2424793005: Add key params for buildbotless bots in DM/nanobench (Closed)
Patch Set: rebase Created 4 years, 2 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 | « infra/bots/recipe_modules/vars/__init__.py ('k') | infra/bots/recipes/swarm_perf.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/recipe_modules/vars/api.py
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 945cf913fac44254c8ca2298b389f3f5d080b1e9..d36ab13a9da1aa0e19b2c22c2dad49fc65268c67 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -35,6 +35,7 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.gclient_env = {}
self.is_compile_bot = self.builder_name.startswith('Build-')
self.no_buildbot = self.m.properties.get('nobuildbot', '') == 'True'
+ self.skia_task_id = self.m.properties.get('skia_task_id', None)
self.default_env['CHROME_HEADLESS'] = '1'
# The 'depot_tools' directory comes from recipe DEPS and isn't provided by
@@ -113,12 +114,16 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.issue = None
self.patchset = None
if self.no_buildbot:
- self.is_trybot = (
- self.m.properties.get('issue', '') and
- self.m.properties.get('patchset', ''))
- if self.is_trybot:
+ if (self.m.properties.get('issue', '') and
+ self.m.properties.get('patchset', '')):
+ self.is_trybot = True
self.issue = self.m.properties['issue']
self.patchset = self.m.properties['patchset']
+ elif (self.m.properties.get('event.change.number', '') and
+ self.m.properties.get('event.patchSet.ref', '')):
+ self.is_trybot = True
+ self.issue = self.m.properties['event.change.number']
+ self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1]
else:
self.is_trybot = self.builder_cfg['is_trybot']
if self.is_trybot:
@@ -133,6 +138,8 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.swarming_out_dir, 'dm')
self.perf_data_dir = self.m.path.join(self.swarming_out_dir,
'perfdata', self.builder_name, 'data')
+ self._swarming_bot_id = None
+ self._swarming_task_id = None
@property
def upload_dm_results(self):
@@ -171,3 +178,26 @@ class SkiaVarsApi(recipe_api.RecipeApi):
upload_perf_results = False
break
return upload_perf_results
+
+ @property
+ def swarming_bot_id(self):
+ if not self._swarming_bot_id:
+ self._swarming_bot_id = self.m.python.inline(
+ name='get swarming bot id',
+ program='''import os
+print os.environ.get('SWARMING_BOT_ID', '')
+''',
+ stdout=self.m.raw_io.output()).stdout.rstrip()
+ return self._swarming_bot_id
+
+ @property
+ def swarming_task_id(self):
+ if not self._swarming_task_id:
+ self._swarming_task_id = self.m.python.inline(
+ name='get swarming task id',
+ program='''import os
+print os.environ.get('SWARMING_TASK_ID', '')
+''',
+ stdout=self.m.raw_io.output()).stdout.rstrip()
+ return self._swarming_task_id
+
« no previous file with comments | « infra/bots/recipe_modules/vars/__init__.py ('k') | infra/bots/recipes/swarm_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698