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

Side by Side Diff: infra/bots/recipes/upload_nano_results.py

Issue 2364693003: Add swarming task for nanobench upload (Closed)
Patch Set: Add CPU dimension 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 unified diff | Download patch
OLDNEW
(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 api.step('upload',
52 cmd=['gsutil', 'cp', '-a', 'public-read', '-z', 'json', src, dst],
53 infra_step=True)
54
55
56 def GenTests(api):
57 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
58 yield (
59 api.test('normal_bot') +
60 api.properties(buildername=builder,
61 revision='abc123',
62 path_config='kitchen')
63 )
64
65 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot'
66 yield (
67 api.test('trybot') +
68 api.properties(buildername=builder,
69 revision='abc123',
70 path_config='kitchen',
71 issue='12345',
72 patchset='1002')
73 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698