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