| 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 DM results. | 6 # Recipe for uploading DM results. |
| 7 | 7 |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'build/file', | 10 'build/file', |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 if builder_name.endswith('-Trybot'): | 35 if builder_name.endswith('-Trybot'): |
| 36 if patch_storage == 'gerrit': | 36 if patch_storage == 'gerrit': |
| 37 issue = str(api.properties['event.change.number']) | 37 issue = str(api.properties['event.change.number']) |
| 38 patchset = str(api.properties['event.patchSet.ref'].split('/')[-1]) | 38 patchset = str(api.properties['event.patchSet.ref'].split('/')[-1]) |
| 39 else: | 39 else: |
| 40 issue = str(api.properties['issue']) | 40 issue = str(api.properties['issue']) |
| 41 patchset = str(api.properties['patchset']) | 41 patchset = str(api.properties['patchset']) |
| 42 | 42 |
| 43 results_dir = api.path['cwd'].join('dm') | 43 results_dir = api.path['cwd'].join('dm') |
| 44 | 44 |
| 45 # Validate the JSON file. | 45 # Move dm.json and verbose.log to their own directory. |
| 46 json_file = results_dir.join(DM_JSON) | 46 json_file = results_dir.join(DM_JSON) |
| 47 api.json.read('validate dm.json', json_file) | |
| 48 | |
| 49 # Move dm.json and verbose.log to their own directory. | |
| 50 log_file = results_dir.join(VERBOSE_LOG) | 47 log_file = results_dir.join(VERBOSE_LOG) |
| 51 tmp_dir = api.path['cwd'].join('tmp_upload') | 48 tmp_dir = api.path['cwd'].join('tmp_upload') |
| 52 api.shutil.makedirs('tmp dir', tmp_dir, infra_step=True) | 49 api.shutil.makedirs('tmp dir', tmp_dir, infra_step=True) |
| 53 api.shutil.copy('copy dm.json', json_file, tmp_dir) | 50 api.shutil.copy('copy dm.json', json_file, tmp_dir) |
| 54 api.shutil.copy('copy verbose.log', log_file, tmp_dir) | 51 api.shutil.copy('copy verbose.log', log_file, tmp_dir) |
| 55 api.shutil.remove('rm old dm.json', json_file) | 52 api.shutil.remove('rm old dm.json', json_file) |
| 56 api.shutil.remove('rm old verbose.log', log_file) | 53 api.shutil.remove('rm old verbose.log', log_file) |
| 57 | 54 |
| 58 # Upload the images. | 55 # Upload the images. |
| 59 image_dest_path = '/'.join((GS_BUCKET, 'dm-images-v1')) | 56 image_dest_path = '/'.join((GS_BUCKET, 'dm-images-v1')) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 'event.change.number': '2100', | 118 'event.change.number': '2100', |
| 122 } | 119 } |
| 123 yield ( | 120 yield ( |
| 124 api.test('recipe_with_gerrit_patch') + | 121 api.test('recipe_with_gerrit_patch') + |
| 125 api.properties( | 122 api.properties( |
| 126 buildername=builder, | 123 buildername=builder, |
| 127 revision='abc123', | 124 revision='abc123', |
| 128 path_config='kitchen', | 125 path_config='kitchen', |
| 129 **gerrit_kwargs) | 126 **gerrit_kwargs) |
| 130 ) | 127 ) |
| OLD | NEW |