diff options
author | Eric Boren <borenet@google.com> | 2016-09-27 11:30:48 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-09-27 15:54:27 +0000 |
commit | cfdd64f41f957d7465658c42dfa39802dd6c702c (patch) | |
tree | b32c5a31c6f9848af5b4da6983da034c6eb5d7b1 /infra/bots/recipes/upload_nano_results.py | |
parent | 600c6a716df4aa72af873471f4a6bd3a851ceca1 (diff) |
Fix dm/nanobench uploads for Gerrit-based trybots
BUG=skia:5719
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2710
Change-Id: I43f03b19a9d7223b67de7dc7c4efea8cb75dba05
Reviewed-on: https://skia-review.googlesource.com/2710
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipes/upload_nano_results.py')
-rw-r--r-- | infra/bots/recipes/upload_nano_results.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/infra/bots/recipes/upload_nano_results.py b/infra/bots/recipes/upload_nano_results.py index 2abe388e85..1508f03080 100644 --- a/infra/bots/recipes/upload_nano_results.py +++ b/infra/bots/recipes/upload_nano_results.py @@ -18,8 +18,17 @@ DEPS = [ def RunSteps(api): # Upload the nanobench resuls. builder_name = api.properties['buildername'] - issue = str(api.properties.get('issue', '')) - patchset = str(api.properties.get('patchset', '')) + + patch_storage = api.properties.get('patch_storage', 'rietveld') + issue = None + patchset = None + if builder_name.endswith('-Trybot'): + if patch_storage == 'gerrit': + issue = str(api.properties['event.change.number']) + patchset = str(api.properties['event.patchSet.ref'].split('/')[-1]) + else: + issue = str(api.properties['issue']) + patchset = str(api.properties['patchset']) now = api.time.utcnow() @@ -71,3 +80,18 @@ def GenTests(api): issue='12345', patchset='1002') ) + + gerrit_kwargs = { + 'patch_storage': 'gerrit', + 'repository': 'skia', + 'event.patchSet.ref': 'refs/changes/00/2100/2', + 'event.change.number': '2100', + } + yield ( + api.test('recipe_with_gerrit_patch') + + api.properties( + buildername=builder, + revision='abc123', + path_config='kitchen', + **gerrit_kwargs) + ) |