| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 5 |
| 6 # Recipe for uploading nanobench results. | 6 # Recipe for uploading nanobench results. |
| 7 | 7 |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'build/file', | 10 'build/file', |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 basename = api.path.basename(src) | 36 basename = api.path.basename(src) |
| 37 gs_path = '/'.join(( | 37 gs_path = '/'.join(( |
| 38 'nano-json-v1', str(now.year).zfill(4), | 38 'nano-json-v1', str(now.year).zfill(4), |
| 39 str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2), | 39 str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2), |
| 40 builder_name)) | 40 builder_name)) |
| 41 | 41 |
| 42 issue = str(api.properties.get('issue', '')) | 42 issue = str(api.properties.get('issue', '')) |
| 43 patchset = str(api.properties.get('patchset', '')) | 43 patchset = str(api.properties.get('patchset', '')) |
| 44 if (api.properties.get('patch_storage', '') == 'gerrit' and | 44 if (api.properties.get('patch_storage', '') == 'gerrit' and |
| 45 api.properties.get('nobuildbot', '') != 'True'): | 45 api.properties.get('nobuildbot', '') != 'True'): |
| 46 issue = str(api.properties['event.change.number']) | 46 issue = str(api.properties['patch_issue']) |
| 47 patchset = str(api.properties['event.patchSet.ref']).split('/')[-1] | 47 patchset = str(api.properties['patch_ref']).split('/')[-1] |
| 48 if issue and patchset: | 48 if issue and patchset: |
| 49 gs_path = '/'.join(('trybot', gs_path, issue, patchset)) | 49 gs_path = '/'.join(('trybot', gs_path, issue, patchset)) |
| 50 | 50 |
| 51 dst = '/'.join(('gs://skia-perf', gs_path, basename)) | 51 dst = '/'.join(('gs://skia-perf', gs_path, basename)) |
| 52 | 52 |
| 53 api.step('upload', | 53 api.step('upload', |
| 54 cmd=['gsutil', 'cp', '-a', 'public-read', '-z', 'json', src, dst], | 54 cmd=['gsutil', 'cp', '-a', 'public-read', '-z', 'json', src, dst], |
| 55 infra_step=True) | 55 infra_step=True) |
| 56 | 56 |
| 57 | 57 |
| 58 def GenTests(api): | 58 def GenTests(api): |
| 59 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug' | 59 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug' |
| 60 yield ( | 60 yield ( |
| 61 api.test('normal_bot') + | 61 api.test('normal_bot') + |
| 62 api.properties(buildername=builder, | 62 api.properties(buildername=builder, |
| 63 revision='abc123', | 63 revision='abc123', |
| 64 path_config='kitchen') | 64 path_config='kitchen') |
| 65 ) | 65 ) |
| 66 | 66 |
| 67 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot' | 67 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot' |
| 68 yield ( | 68 yield ( |
| 69 api.test('trybot') + | 69 api.test('trybot') + |
| 70 api.properties(buildername=builder, | 70 api.properties(buildername=builder, |
| 71 revision='abc123', | 71 revision='abc123', |
| 72 path_config='kitchen', | 72 path_config='kitchen', |
| 73 issue='12345', | 73 issue='12345', |
| 74 patchset='1002') | 74 patchset='1002') |
| 75 ) | 75 ) |
| 76 | 76 |
| 77 gerrit_kwargs = { | |
| 78 'patch_storage': 'gerrit', | |
| 79 'repository': 'skia', | |
| 80 'event.patchSet.ref': 'refs/changes/00/2100/2', | |
| 81 'event.change.number': '2100', | |
| 82 } | |
| 83 yield ( | 77 yield ( |
| 84 api.test('recipe_with_gerrit_patch') + | 78 api.test('recipe_with_gerrit_patch') + |
| 85 api.properties( | 79 api.properties( |
| 86 buildername=builder, | 80 buildername=builder, |
| 87 revision='abc123', | 81 revision='abc123', |
| 88 path_config='kitchen', | 82 path_config='kitchen', |
| 89 **gerrit_kwargs) | 83 patch_storage='gerrit') + |
| 84 api.properties.tryserver( |
| 85 buildername=builder, |
| 86 gerrit_project='skia', |
| 87 gerrit_url='https://skia-review.googlesource.com/', |
| 88 ) |
| 90 ) | 89 ) |
| OLD | NEW |