| 1 |
# Copyright 2018 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 |
# Recipe which runs the Canvaskit tests using docker |
| 6 |
|
| 7 |
|
| 8 |
DEPS = [ |
| 9 |
'checkout', |
| 10 |
'docker', |
| 11 |
'env', |
| 12 |
'flavor', |
| 13 |
'infra', |
| 14 |
'recipe_engine/file', |
| 15 |
'recipe_engine/path', |
| 16 |
'recipe_engine/properties', |
| 17 |
'recipe_engine/step', |
| 18 |
'gold_upload', |
| 19 |
'run', |
| 20 |
'vars', |
| 21 |
] |
| 22 |
|
| 23 |
|
| 24 |
DOCKER_IMAGE = 'gcr.io/skia-public/gold-karma-chrome-tests:87.0.4280.88_v2' |
| 25 |
INNER_KARMA_SCRIPT = 'skia/infra/canvaskit/test_canvaskit.sh' |
| 26 |
|
| 27 |
def RunSteps(api): |
| 28 |
api.vars.setup() |
| 29 |
api.flavor.setup('dm') |
| 30 |
checkout_root = api.path.start_dir |
| 31 |
out_dir = api.vars.swarming_out_dir |
| 32 |
|
| 33 |
# The karma script is configured to look in ./build/ for |
| 34 |
# the test files to load, so we must copy them there (see Set up for docker). |
| 35 |
copy_dest = checkout_root.joinpath('skia', 'modules', 'canvaskit', |
| 36 |
'build') |
| 37 |
api.file.ensure_directory('mkdirs copy_dest', copy_dest, mode=0o777) |
| 38 |
base_dir = api.vars.build_dir |
| 39 |
copies = [ |
| 40 |
{ |
| 41 |
'src': base_dir.joinpath('canvaskit.js'), |
| 42 |
'dst': copy_dest.joinpath('canvaskit.js'), |
| 43 |
}, |
| 44 |
{ |
| 45 |
'src': base_dir.joinpath('canvaskit.wasm'), |
| 46 |
'dst': copy_dest.joinpath('canvaskit.wasm'), |
| 47 |
}, |
| 48 |
] |
| 49 |
recursive_read = [checkout_root.joinpath('skia')] |
| 50 |
|
| 51 |
args = [ |
| 52 |
'--builder', api.vars.builder_name, |
| 53 |
'--git_hash', api.properties['revision'], |
| 54 |
'--buildbucket_build_id', api.properties.get('buildbucket_build_id', ''), |
| 55 |
'--browser', 'Chrome', |
| 56 |
'--config', api.vars.configuration, |
| 57 |
'--source_type', 'canvaskit', |
| 58 |
] |
| 59 |
if api.vars.is_trybot: |
| 60 |
args.extend([ |
| 61 |
'--issue', api.vars.issue, |
| 62 |
'--patchset', api.vars.patchset, |
| 63 |
]) |
| 64 |
|
| 65 |
api.docker.run( |
| 66 |
name='Test CanvasKit with Docker', |
| 67 |
docker_image=DOCKER_IMAGE, |
| 68 |
src_dir=checkout_root, |
| 69 |
out_dir=out_dir, |
| 70 |
script=checkout_root.joinpath(INNER_KARMA_SCRIPT), |
| 71 |
args=args, |
| 72 |
docker_args=None, |
| 73 |
copies=copies, |
| 74 |
recursive_read=recursive_read, |
| 75 |
attempts=3, |
| 76 |
) |
| 77 |
|
| 78 |
api.gold_upload.upload() |
| 79 |
|
| 80 |
def GenTests(api): |
| 81 |
yield ( |
| 82 |
api.test('Test-Debian10-EMCC-GCE-GPU-WEBGL1-wasm-Debug-All-CanvasKit') + |
| 83 |
api.properties(buildername=('Test-Debian10-EMCC-GCE-GPU-WEBGL1' |
| 84 |
'-wasm-Debug-All-CanvasKit'), |
| 85 |
repository='https://skia.googlesource.com/skia.git', |
| 86 |
revision='abc123', |
| 87 |
gs_bucket='skia-infra-gm', |
| 88 |
path_config='kitchen', |
| 89 |
swarm_out_dir='[SWARM_OUT_DIR]') |
| 90 |
) |
| 91 |
|
| 92 |
yield ( |
| 93 |
api.test('canvaskit_trybot') + |
| 94 |
api.properties(buildername=('Test-Debian10-EMCC-GCE-CPU-AVX2' |
| 95 |
'-wasm-Debug-All-CanvasKit'), |
| 96 |
repository='https://skia.googlesource.com/skia.git', |
| 97 |
revision='abc123', |
| 98 |
gs_bucket='skia-infra-gm', |
| 99 |
path_config='kitchen', |
| 100 |
swarm_out_dir='[SWARM_OUT_DIR]', |
| 101 |
patch_ref='89/456789/12', |
| 102 |
patch_repo='https://skia.googlesource.com/skia.git', |
| 103 |
patch_storage='gerrit', |
| 104 |
patch_set=7, |
| 105 |
patch_issue=1234, |
| 106 |
gerrit_project='skia', |
| 107 |
gerrit_url='https://skia-review.googlesource.com/') |
| 108 |
) |