| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 # Recipe which runs the Skia presubmit. | 6 # Recipe which runs the Skia presubmit. |
| 7 | 7 |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'core', | 10 'core', |
| 11 'depot_tools/depot_tools', |
| 12 'recipe_engine/path', |
| 11 'recipe_engine/properties', | 13 'recipe_engine/properties', |
| 12 'recipe_engine/step', | 14 'recipe_engine/step', |
| 15 'recipe_engine/uuid', |
| 13 'vars', | 16 'vars', |
| 14 ] | 17 ] |
| 15 | 18 |
| 16 | 19 |
| 17 def RunSteps(api): | 20 def RunSteps(api): |
| 18 api.vars.setup() | 21 api.vars.setup() |
| 19 api.core.checkout_steps() | 22 api.core.checkout_steps() |
| 20 api.step('presubmit', | 23 |
| 21 cmd=['git', 'cl', 'presubmit', '--force'], | 24 # git-cl wants us to be on a branch. |
| 25 branch = 'tmp_%s' % api.uuid.random() |
| 26 api.step('create git branch', |
| 27 cmd=['git', 'checkout', '-b', branch], |
| 22 cwd=api.vars.skia_dir) | 28 cwd=api.vars.skia_dir) |
| 29 try: |
| 30 api.step('git status', |
| 31 cmd=['git', 'status'], |
| 32 cwd=api.vars.skia_dir) |
| 33 |
| 34 depot_tools_path = api.depot_tools.package_repo_resource() |
| 35 env = {'PATH': api.path.pathsep.join([str(depot_tools_path), '%(PATH)s'])} |
| 36 api.step('presubmit', |
| 37 cmd=['git', 'cl', 'presubmit', '--force', '-v', '-v'], |
| 38 cwd=api.vars.skia_dir, |
| 39 env=env) |
| 40 finally: |
| 41 api.step('git reset', |
| 42 cmd=['git', 'reset', '--hard', 'origin/master'], |
| 43 cwd=api.vars.skia_dir) |
| 44 api.step('checkout origin/master', |
| 45 cmd=['git', 'checkout', 'origin/master'], |
| 46 cwd=api.vars.skia_dir) |
| 47 api.step('delete git branch', |
| 48 cmd=['git', 'branch', '-D', branch], |
| 49 cwd=api.vars.skia_dir) |
| 50 |
| 23 | 51 |
| 24 | 52 |
| 25 def GenTests(api): | 53 def GenTests(api): |
| 26 yield ( | 54 yield ( |
| 27 api.test('presubmit') + | 55 api.test('presubmit') + |
| 28 api.properties(buildername='Housekeeper-PerCommit-Presubmit', | 56 api.properties(buildername='Housekeeper-PerCommit-Presubmit', |
| 29 mastername='client.skia.fyi', | 57 mastername='client.skia.fyi', |
| 30 slavename='dummy-slave', | 58 slavename='dummy-slave', |
| 31 buildnumber=5, | 59 buildnumber=5, |
| 32 revision='abc123', | 60 revision='abc123', |
| 33 path_config='kitchen', | 61 path_config='kitchen', |
| 34 swarm_out_dir='[SWARM_OUT_DIR]') | 62 swarm_out_dir='[SWARM_OUT_DIR]') |
| 35 ) | 63 ) |
| OLD | NEW |