2018-10-12 19:21:17 +00:00
|
|
|
# Copyright 2018 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 which runs the PathKit tests using docker
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
'checkout',
|
2019-11-05 15:08:23 +00:00
|
|
|
'docker',
|
2019-01-22 23:09:30 +00:00
|
|
|
'env',
|
2018-10-12 19:21:17 +00:00
|
|
|
'infra',
|
|
|
|
'recipe_engine/file',
|
|
|
|
'recipe_engine/path',
|
|
|
|
'recipe_engine/properties',
|
|
|
|
'recipe_engine/python',
|
|
|
|
'recipe_engine/step',
|
|
|
|
'run',
|
|
|
|
'vars',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2019-10-18 16:39:19 +00:00
|
|
|
DOCKER_IMAGE = 'gcr.io/skia-public/perf-karma-chrome-tests:77.0.3865.120_v1'
|
2019-11-05 15:08:23 +00:00
|
|
|
INNER_KARMA_SCRIPT = 'skia/infra/pathkit/perf_pathkit.sh'
|
2018-10-12 19:21:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
|
|
|
api.vars.setup()
|
2019-11-05 15:08:23 +00:00
|
|
|
checkout_root = api.path['start_dir']
|
2018-10-12 19:21:17 +00:00
|
|
|
out_dir = api.vars.swarming_out_dir
|
|
|
|
|
|
|
|
# Make sure this exists, otherwise Docker will make it with root permissions.
|
|
|
|
api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0777)
|
|
|
|
|
|
|
|
# The karma script is configured to look in ./npm-(asmjs|wasm)/bin/ for
|
|
|
|
# the test files to load, so we must copy them there (see Set up for docker).
|
|
|
|
copy_dest = checkout_root.join('skia', 'modules', 'pathkit',
|
2019-11-05 15:08:23 +00:00
|
|
|
'npm-wasm', 'bin')
|
2018-10-12 19:21:17 +00:00
|
|
|
if 'asmjs' in api.vars.builder_name:
|
|
|
|
copy_dest = checkout_root.join('skia', 'modules', 'pathkit',
|
2019-11-05 15:08:23 +00:00
|
|
|
'npm-asmjs', 'bin')
|
2018-10-12 19:21:17 +00:00
|
|
|
|
|
|
|
base_dir = api.vars.build_dir
|
|
|
|
bundle_name = 'pathkit.wasm'
|
|
|
|
if 'asmjs' in api.vars.builder_name:
|
|
|
|
bundle_name = 'pathkit.js.mem'
|
|
|
|
|
2019-11-05 15:08:23 +00:00
|
|
|
copies = {
|
|
|
|
base_dir.join('pathkit.js'): copy_dest.join('pathkit.js'),
|
|
|
|
base_dir.join(bundle_name): copy_dest.join(bundle_name),
|
|
|
|
}
|
|
|
|
recursive_read = [checkout_root.join('skia')]
|
2018-10-12 19:21:17 +00:00
|
|
|
|
2019-11-05 15:08:23 +00:00
|
|
|
docker_args = None
|
2018-10-12 19:21:17 +00:00
|
|
|
if 'asmjs' in api.vars.builder_name:
|
2019-11-05 15:08:23 +00:00
|
|
|
docker_args = ['--env', 'ASM_JS=1']
|
|
|
|
|
|
|
|
args = [
|
|
|
|
'--builder', api.vars.builder_name,
|
|
|
|
'--git_hash', api.properties['revision'],
|
|
|
|
'--buildbucket_build_id', api.properties.get('buildbucket_build_id', ''),
|
|
|
|
'--bot_id', api.vars.swarming_bot_id,
|
|
|
|
'--task_id', api.vars.swarming_task_id,
|
|
|
|
'--browser', 'Chrome',
|
|
|
|
'--config', api.vars.configuration,
|
|
|
|
'--source_type', 'pathkit',
|
|
|
|
]
|
2018-10-12 19:21:17 +00:00
|
|
|
if 'asmjs' in api.vars.builder_name:
|
2019-11-05 15:08:23 +00:00
|
|
|
args.extend(['--compiled_language', 'asmjs']) # the default is wasm
|
2018-10-12 19:21:17 +00:00
|
|
|
if api.vars.is_trybot:
|
2019-11-05 15:08:23 +00:00
|
|
|
args.extend([
|
2018-10-12 19:21:17 +00:00
|
|
|
'--issue', api.vars.issue,
|
|
|
|
'--patchset', api.vars.patchset,
|
|
|
|
])
|
|
|
|
|
2019-11-05 15:08:23 +00:00
|
|
|
api.docker.run(
|
|
|
|
name='Performance tests of PathKit with Docker',
|
|
|
|
docker_image=DOCKER_IMAGE,
|
|
|
|
src_dir=checkout_root,
|
|
|
|
out_dir=out_dir,
|
2019-11-20 13:28:20 +00:00
|
|
|
script=checkout_root.join(INNER_KARMA_SCRIPT),
|
2019-11-05 15:08:23 +00:00
|
|
|
args=args,
|
|
|
|
docker_args=docker_args,
|
|
|
|
copies=copies,
|
|
|
|
recursive_read=recursive_read,
|
2019-11-21 17:49:16 +00:00
|
|
|
attempts=3,
|
2019-11-05 15:08:23 +00:00
|
|
|
)
|
2018-10-12 19:21:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
|
|
|
yield (
|
2020-04-07 01:27:14 +00:00
|
|
|
api.test('Perf-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-PathKit') +
|
|
|
|
api.properties(buildername=('Perf-Debian10-EMCC-GCE-CPU-AVX2'
|
2018-10-12 19:21:17 +00:00
|
|
|
'-wasm-Release-All-PathKit'),
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]')
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
2020-04-07 01:27:14 +00:00
|
|
|
api.test('Perf-Debian10-EMCC-GCE-CPU-AVX2-asmjs-Release-All-PathKit') +
|
|
|
|
api.properties(buildername=('Perf-Debian10-EMCC-GCE-CPU-AVX2'
|
2018-10-12 19:21:17 +00:00
|
|
|
'-asmjs-Release-All-PathKit'),
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]')
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('pathkit_trybot') +
|
2020-04-07 01:27:14 +00:00
|
|
|
api.properties(buildername=('Perf-Debian10-EMCC-GCE-CPU-AVX2'
|
2018-10-12 19:21:17 +00:00
|
|
|
'-wasm-Release-All-PathKit'),
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]',
|
|
|
|
patch_ref='89/456789/12',
|
|
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
|
|
|
patch_storage='gerrit',
|
|
|
|
patch_set=7,
|
|
|
|
patch_issue=1234,
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/')
|
|
|
|
)
|