1# Copyright 2016 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 6# Recipe module for Skia Swarming calmbench. 7 8DEPS = [ 9 'flavor', 10 'recipe_engine/context', 11 'recipe_engine/file', 12 'recipe_engine/path', 13 'recipe_engine/properties', 14 'recipe_engine/python', 15 'recipe_engine/raw_io', 16 'recipe_engine/step', 17 'recipe_engine/time', 18 'run', 19 'vars', 20] 21 22def RunSteps(api): 23 api.vars.setup() 24 api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir) 25 api.flavor.setup() 26 27 api.flavor.install(skps=True, svgs=True) 28 api.file.ensure_directory('makedirs perf', api.vars.swarming_out_dir) 29 30 skia_dir = api.path['start_dir'].join('skia') 31 with api.context(cwd=skia_dir): 32 extra_arg = '--svgs %s --skps %s' % (api.flavor.device_dirs.svg_dir, 33 api.flavor.device_dirs.skp_dir) 34 35 # measuring multi-picture-draw in our multi-threaded CPU test is inaccurate 36 if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': 37 extra_arg += ' --mpd false' 38 config = "8888" 39 else: 40 config = "gl" 41 42 command = [ 43 'python', 44 skia_dir.join('tools', 'calmbench', 'ab.py'), 45 api.vars.swarming_out_dir, 46 'modified', 'master', 47 api.vars.build_dir.join('nanobench'), 48 api.vars.build_dir.join('ParentRevision', 'nanobench'), 49 extra_arg, extra_arg, 50 2, # reps 51 "false", # skipbase 52 config, 53 -1, # threads; let ab.py decide the threads 54 "false", # noinit 55 "--githash", api.properties['revision'], 56 "--concise" 57 ] 58 59 keys_blacklist = ['configuration', 'role', 'test_filter'] 60 command.append('--keys') 61 for k in sorted(api.vars.builder_cfg.keys()): 62 if not k in keys_blacklist: 63 command.extend([k, api.vars.builder_cfg[k]]) 64 65 api.run(api.step, 'Run calmbench', cmd=command) 66 api.run.check_failure() 67 68def GenTests(api): 69 builders = [ 70 "Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All", 71 "Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All", 72 ] 73 74 for builder in builders: 75 test = ( 76 api.test(builder) + 77 api.properties(buildername=builder, 78 repository='https://skia.googlesource.com/skia.git', 79 revision='abc123', 80 path_config='kitchen', 81 swarm_out_dir='[SWARM_OUT_DIR]') + 82 api.path.exists( 83 api.path['start_dir'].join('skia'), 84 api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', 85 'svg', 'VERSION'), 86 api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', 87 'skp', 'VERSION'), 88 ) 89 ) 90 91 yield test 92