• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7DEPS = [
8  'checkout',
9  'docker',
10  'env',
11  'infra',
12  'recipe_engine/file',
13  'recipe_engine/path',
14  'recipe_engine/properties',
15  'recipe_engine/python',
16  'recipe_engine/step',
17  'run',
18  'vars',
19]
20
21
22DOCKER_IMAGE = 'gcr.io/skia-public/perf-karma-chrome-tests:77.0.3865.120_v1'
23INNER_KARMA_SCRIPT = 'skia/infra/canvaskit/perf_canvaskit.sh'
24
25
26def RunSteps(api):
27  api.vars.setup()
28  checkout_root = api.path['start_dir']
29  out_dir = api.vars.swarming_out_dir
30
31  # The karma script is configured to look in ./canvaskit/bin/ for
32  # the test files to load, so we must copy them there (see Set up for docker).
33  copy_dest = checkout_root.join('skia', 'modules', 'canvaskit',
34                                 'canvaskit', 'bin')
35  base_dir = api.vars.build_dir
36  copies = {
37    base_dir.join('canvaskit.js'):   copy_dest.join('canvaskit.js'),
38    base_dir.join('canvaskit.wasm'): copy_dest.join('canvaskit.wasm'),
39  }
40  recursive_read = [checkout_root.join('skia')]
41
42  args = [
43    '--builder',              api.vars.builder_name,
44    '--git_hash',             api.properties['revision'],
45    '--buildbucket_build_id', api.properties.get('buildbucket_build_id', ''),
46    '--bot_id',               api.vars.swarming_bot_id,
47    '--task_id',              api.vars.swarming_task_id,
48    '--browser',              'Chrome',
49    '--config',               api.vars.configuration,
50    '--source_type',          'canvaskit',
51  ]
52  if api.vars.is_trybot:
53    args.extend([
54      '--issue',         api.vars.issue,
55      '--patchset',      api.vars.patchset,
56    ])
57
58  api.docker.run(
59      name='Performance tests of CanvasKit with Docker',
60      docker_image=DOCKER_IMAGE,
61      src_dir=checkout_root,
62      out_dir=out_dir,
63      script=checkout_root.join(INNER_KARMA_SCRIPT),
64      args=args,
65      docker_args=None,
66      copies=copies,
67      recursive_read=recursive_read,
68      attempts=3,
69  )
70
71
72def GenTests(api):
73  yield (
74      api.test('Perf-Debian9-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit') +
75      api.properties(buildername=('Perf-Debian9-EMCC-GCE-CPU-AVX2'
76                                  '-wasm-Release-All-CanvasKit'),
77                     repository='https://skia.googlesource.com/skia.git',
78                     revision='abc123',
79                     path_config='kitchen',
80                     swarm_out_dir='[SWARM_OUT_DIR]')
81  )
82
83  yield (
84      api.test('pathkit_trybot') +
85      api.properties(buildername=('Perf-Debian9-EMCC-GCE-GPU-AVX2'
86                                  '-wasm-Release-All-CanvasKit'),
87                     repository='https://skia.googlesource.com/skia.git',
88                     revision='abc123',
89                     path_config='kitchen',
90                     swarm_out_dir='[SWARM_OUT_DIR]',
91                     patch_ref='89/456789/12',
92                     patch_repo='https://skia.googlesource.com/skia.git',
93                     patch_storage='gerrit',
94                     patch_set=7,
95                     patch_issue=1234,
96                     gerrit_project='skia',
97                     gerrit_url='https://skia-review.googlesource.com/')
98  )
99