Eric Boren | 8b3f9e6 | 2017-04-04 09:06:16 -0400 | [diff] [blame] | 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 compile. |
| 7 | |
| 8 | |
| 9 | DEPS = [ |
| 10 | 'recipe_engine/path', |
| 11 | 'recipe_engine/properties', |
| 12 | 'recipe_engine/shutil', |
| 13 | 'recipe_engine/step', |
| 14 | 'core', |
| 15 | 'run', |
| 16 | 'vars', |
| 17 | ] |
| 18 | |
| 19 | |
| 20 | def RunSteps(api): |
| 21 | api.core.setup() |
Eric Boren | 43b9c6b | 2017-04-06 07:53:30 -0400 | [diff] [blame^] | 22 | |
| 23 | bundle_dir = api.vars.swarming_out_dir.join('recipe_bundle') |
| 24 | with api.step.context({'cwd': api.vars.skia_dir}): |
| 25 | if api.vars.is_trybot: |
| 26 | # Recipe bundling requires that any changes be committed. |
| 27 | api.run(api.step, 'Commit Patch', infra_step=True, |
| 28 | cmd=['git', 'commit', '-a', '-m', 'Commit Patch']) |
| 29 | recipes_py = api.vars.infrabots_dir.join('recipes.py') |
| 30 | api.run(api.step, 'Bundle Recipes', infra_step=True, |
| 31 | cmd=['python', recipes_py, 'bundle', '--destination', bundle_dir]) |
| 32 | |
Eric Boren | 8b3f9e6 | 2017-04-04 09:06:16 -0400 | [diff] [blame] | 33 | api.run.check_failure() |
| 34 | |
| 35 | |
| 36 | def GenTests(api): |
| 37 | yield ( |
| 38 | api.test('BundleRecipes') + |
| 39 | api.properties(buildername='Housekeeper-PerCommit-BundleRecipes', |
| 40 | mastername='fake-master', |
| 41 | slavename='fake-slave', |
| 42 | buildnumber=5, |
| 43 | repository='https://skia.googlesource.com/skia.git', |
| 44 | revision='abc123', |
| 45 | path_config='kitchen', |
Eric Boren | 43b9c6b | 2017-04-06 07:53:30 -0400 | [diff] [blame^] | 46 | swarm_out_dir='[SWARM_OUT_DIR]', |
| 47 | nobuildbot='True', |
| 48 | patch_issue='10101', |
| 49 | patch_set='3') + |
Eric Boren | 8b3f9e6 | 2017-04-04 09:06:16 -0400 | [diff] [blame] | 50 | api.path.exists( |
| 51 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
| 52 | ) |
| 53 | ) |