Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 | |
| 6 # Recipe for uploading nanobench results. | |
| 7 | |
| 8 | |
| 9 DEPS = [ | |
| 10 'build/file', | |
| 11 'recipe_engine/path', | |
| 12 'recipe_engine/properties', | |
| 13 'recipe_engine/step', | |
| 14 'recipe_engine/time', | |
| 15 ] | |
| 16 | |
| 17 | |
| 18 def RunSteps(api): | |
| 19 # Upload the nanobench resuls. | |
| 20 builder_name = api.properties['buildername'] | |
| 21 issue = str(api.properties.get('issue')) | |
| 22 patchset = str(api.properties.get('patchset')) | |
| 23 | |
| 24 now = api.time.utcnow() | |
| 25 | |
| 26 src_path = api.path['cwd'].join( | |
| 27 'perfdata', builder_name, 'data') | |
| 28 results = api.file.glob( | |
| 29 'find results', | |
| 30 'nanobench*.json', | |
| 31 cwd=src_path, | |
| 32 test_data=['nanobench_abc123.json'], | |
| 33 infra_step=True) | |
| 34 if len(results) != 1: # pragma: nocover | |
| 35 raise Exception('Unable to find nanobench JSON file!') | |
| 36 | |
| 37 src = src_path.join(results[0]) | |
| 38 basename = api.path.basename(src) | |
| 39 gs_path = '/'.join(( | |
| 40 'nano-json-v1', str(now.year).zfill(4), | |
| 41 str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2), | |
| 42 builder_name)) | |
| 43 | |
| 44 if builder_name.endswith('-Trybot'): | |
| 45 if not (issue and patchset): # pragma: nocover | |
| 46 raise Exception('issue and patchset properties are required for trybots.') | |
| 47 gs_path = '/'.join(('trybot', gs_path, issue, patchset)) | |
| 48 | |
| 49 dst = '/'.join(('gs://skia-perf', gs_path, basename)) | |
| 50 | |
| 51 gsutil = 'gsutil' | |
|
rmistry
2016/09/23 12:01:29
Nit: This seems like an unnecessary abstraction wh
borenet
2016/09/23 12:14:32
Removed. I was sure I'd have to provide an absolut
| |
| 52 api.step('upload', | |
| 53 cmd=[gsutil, 'cp', '-a', 'public-read', '-z', 'json', src, dst], | |
| 54 infra_step=True) | |
| 55 | |
| 56 | |
| 57 def GenTests(api): | |
| 58 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug' | |
| 59 yield ( | |
| 60 api.test('normal_bot') + | |
| 61 api.properties(buildername=builder, | |
| 62 revision='abc123', | |
| 63 path_config='kitchen') | |
| 64 ) | |
| 65 | |
| 66 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot' | |
| 67 yield ( | |
| 68 api.test('trybot') + | |
| 69 api.properties(buildername=builder, | |
| 70 revision='abc123', | |
| 71 path_config='kitchen', | |
| 72 issue='12345', | |
| 73 patchset='1002') | |
| 74 ) | |
| OLD | NEW |