2016-09-23 13:37:57 +00:00
|
|
|
# Copyright 2016 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
# Recipe for uploading nanobench results.
|
|
|
|
|
|
|
|
|
|
|
|
DEPS = [
|
2017-04-10 12:19:10 +00:00
|
|
|
'build/file',
|
|
|
|
'recipe_engine/path',
|
2016-09-23 13:37:57 +00:00
|
|
|
'recipe_engine/properties',
|
2017-04-10 12:19:10 +00:00
|
|
|
'recipe_engine/step',
|
|
|
|
'recipe_engine/time',
|
2016-09-23 13:37:57 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
2017-04-10 12:19:10 +00:00
|
|
|
# Upload the nanobench resuls.
|
|
|
|
builder_name = api.properties['buildername']
|
|
|
|
|
|
|
|
now = api.time.utcnow()
|
|
|
|
src_path = api.path['start_dir'].join(
|
|
|
|
'perfdata', builder_name, 'data')
|
|
|
|
with api.step.context({'cwd': src_path}):
|
|
|
|
results = api.file.glob(
|
|
|
|
'find results',
|
|
|
|
src_path.join('*.json'),
|
|
|
|
test_data=[src_path.join('nanobench_abc123.json')],
|
|
|
|
infra_step=True)
|
|
|
|
if len(results) != 1: # pragma: nocover
|
|
|
|
raise Exception('Unable to find nanobench or skpbench JSON file!')
|
|
|
|
|
|
|
|
src = results[0]
|
|
|
|
basename = api.path.basename(src)
|
|
|
|
gs_path = '/'.join((
|
|
|
|
'nano-json-v1', str(now.year).zfill(4),
|
|
|
|
str(now.month).zfill(2), str(now.day).zfill(2), str(now.hour).zfill(2),
|
|
|
|
builder_name))
|
|
|
|
|
|
|
|
issue = str(api.properties.get('issue', ''))
|
|
|
|
patchset = str(api.properties.get('patchset', ''))
|
|
|
|
if api.properties.get('patch_storage', '') == 'gerrit':
|
|
|
|
issue = str(api.properties['patch_issue'])
|
|
|
|
patchset = str(api.properties['patch_set'])
|
|
|
|
if issue and patchset:
|
|
|
|
gs_path = '/'.join(('trybot', gs_path, issue, patchset))
|
|
|
|
|
|
|
|
dst = '/'.join((
|
|
|
|
'gs://%s' % api.properties['gs_bucket'], gs_path, basename))
|
|
|
|
|
|
|
|
api.step(
|
|
|
|
'upload',
|
|
|
|
cmd=['gsutil', 'cp', '-z', 'json', src, dst],
|
|
|
|
infra_step=True)
|
2016-09-23 13:37:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
2017-04-10 12:19:10 +00:00
|
|
|
builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug'
|
2016-09-23 13:37:57 +00:00
|
|
|
yield (
|
2017-04-10 12:19:10 +00:00
|
|
|
api.test('normal_bot') +
|
|
|
|
api.properties(buildername=builder,
|
2017-02-06 20:38:41 +00:00
|
|
|
gs_bucket='skia-perf',
|
2016-09-23 13:37:57 +00:00
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen')
|
|
|
|
)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot'
|
|
|
|
yield (
|
|
|
|
api.test('trybot') +
|
|
|
|
api.properties(buildername=builder,
|
|
|
|
gs_bucket='skia-perf',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
issue='12345',
|
|
|
|
patchset='1002')
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('recipe_with_gerrit_patch') +
|
|
|
|
api.properties(
|
|
|
|
buildername=builder,
|
|
|
|
gs_bucket='skia-perf',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
patch_storage='gerrit') +
|
|
|
|
api.properties.tryserver(
|
|
|
|
buildername=builder,
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
|
|
)
|
|
|
|
)
|