2016-07-26 18:52:17 +00:00
|
|
|
# Copyright 2014 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 the Skia PerCommit Housekeeper.
|
|
|
|
|
2018-03-12 12:59:00 +00:00
|
|
|
|
|
|
|
import calendar
|
|
|
|
|
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
DEPS = [
|
2017-04-10 15:23:04 +00:00
|
|
|
'depot_tools/bot_update',
|
2017-05-13 02:09:38 +00:00
|
|
|
'recipe_engine/context',
|
2018-03-12 12:59:00 +00:00
|
|
|
'recipe_engine/file',
|
2016-07-26 18:52:17 +00:00
|
|
|
'recipe_engine/path',
|
|
|
|
'recipe_engine/properties',
|
|
|
|
'recipe_engine/python',
|
|
|
|
'recipe_engine/step',
|
2018-03-12 12:59:00 +00:00
|
|
|
'recipe_engine/time',
|
2017-02-02 14:02:37 +00:00
|
|
|
'core',
|
|
|
|
'run',
|
|
|
|
'vars',
|
2016-07-26 18:52:17 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
|
|
|
# Checkout, compile, etc.
|
2016-08-03 15:23:10 +00:00
|
|
|
api.core.setup()
|
2016-07-26 18:52:17 +00:00
|
|
|
|
|
|
|
cwd = api.path['checkout']
|
|
|
|
|
|
|
|
# TODO(borenet): Detect static initializers?
|
|
|
|
|
2017-05-13 02:09:38 +00:00
|
|
|
with api.context(cwd=cwd):
|
2017-03-20 19:40:12 +00:00
|
|
|
if not api.vars.is_trybot:
|
|
|
|
api.run(
|
|
|
|
api.step,
|
|
|
|
'generate and upload doxygen',
|
|
|
|
cmd=['python', api.core.resource('generate_and_upload_doxygen.py')],
|
|
|
|
abort_on_failure=False)
|
|
|
|
|
2018-03-12 12:59:00 +00:00
|
|
|
now = api.time.utcnow()
|
|
|
|
ts = int(calendar.timegm(now.utctimetuple()))
|
|
|
|
filename = 'nanobench_%s_%d.json' % (api.vars.got_revision, ts)
|
|
|
|
dest_dir = api.vars.perf_data_dir
|
|
|
|
dest_file = dest_dir + '/' + filename
|
|
|
|
api.file.ensure_directory('makedirs perf_dir', dest_dir)
|
2017-03-20 19:40:12 +00:00
|
|
|
cmd = ['python', api.core.resource('run_binary_size_analysis.py'),
|
2018-03-12 12:59:00 +00:00
|
|
|
'--library', api.vars.skia_out.join('Release', 'libskia.so'),
|
2017-03-20 19:40:12 +00:00
|
|
|
'--githash', api.properties['revision'],
|
2018-03-12 12:59:00 +00:00
|
|
|
'--dest', dest_file]
|
2017-03-20 19:40:12 +00:00
|
|
|
if api.vars.is_trybot:
|
|
|
|
cmd.extend(['--issue_number', str(api.properties['patch_issue'])])
|
2016-08-03 15:23:10 +00:00
|
|
|
api.run(
|
2016-07-26 18:52:17 +00:00
|
|
|
api.step,
|
2018-03-12 12:59:00 +00:00
|
|
|
'generate binary size data',
|
|
|
|
cmd=cmd)
|
2016-07-26 18:52:17 +00:00
|
|
|
|
2016-08-12 15:50:29 +00:00
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
def GenTests(api):
|
2016-12-02 16:01:33 +00:00
|
|
|
yield (
|
|
|
|
api.test('Housekeeper-PerCommit') +
|
|
|
|
api.properties(buildername='Housekeeper-PerCommit',
|
2017-01-17 19:35:06 +00:00
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
2016-12-02 16:01:33 +00:00
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.path.exists(api.path['start_dir'])
|
|
|
|
)
|
|
|
|
yield (
|
|
|
|
api.test('Housekeeper-PerCommit-Trybot') +
|
|
|
|
api.properties(buildername='Housekeeper-PerCommit',
|
2017-01-17 19:35:06 +00:00
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
2016-12-02 16:01:33 +00:00
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
patch_storage='gerrit',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
|
|
api.properties.tryserver(
|
|
|
|
buildername='Housekeeper-PerCommit',
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
|
|
) +
|
|
|
|
api.path.exists(api.path['start_dir'])
|
|
|
|
)
|