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 which runs the Skia presubmit. 7 8 9DEPS = [ 10 'depot_tools/depot_tools', 11 'recipe_engine/path', 12 'recipe_engine/properties', 13 'recipe_engine/step', 14 'recipe_engine/uuid', 15 'core', 16 'vars', 17] 18 19 20def RunSteps(api): 21 api.vars.setup() 22 api.core.checkout_steps() 23 24 with api.step.context({'cwd': api.vars.skia_dir}): 25 # git-cl wants us to be on a branch. 26 branch = 'tmp_%s' % api.uuid.random() 27 api.step('create git branch', 28 cmd=['git', 'checkout', '-b', branch]) 29 try: 30 api.step('git status', 31 cmd=['git', 'status']) 32 33 depot_tools_path = api.depot_tools.package_repo_resource() 34 env = {'PATH': api.path.pathsep.join([str(depot_tools_path), '%(PATH)s'])} 35 with api.step.context({'env': env}): 36 api.step('presubmit', 37 cmd=['git', 'cl', 'presubmit', '--force', '-v', '-v']) 38 finally: 39 api.step('git reset', 40 cmd=['git', 'reset', '--hard', 'origin/master']) 41 api.step('checkout origin/master', 42 cmd=['git', 'checkout', 'origin/master']) 43 api.step('delete git branch', 44 cmd=['git', 'branch', '-D', branch]) 45 46 47def GenTests(api): 48 yield ( 49 api.test('presubmit') + 50 api.properties(buildername='Housekeeper-PerCommit-Presubmit', 51 mastername='client.skia.fyi', 52 slavename='dummy-slave', 53 buildnumber=5, 54 repository='https://skia.googlesource.com/skia.git', 55 revision='abc123', 56 path_config='kitchen', 57 swarm_out_dir='[SWARM_OUT_DIR]') 58 ) 59