borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 1 | # Copyright 2014 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 for the Skia PerCommit Housekeeper. |
| 7 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 8 | DEPS = [ |
| 9 | 'recipe_engine/path', |
| 10 | 'recipe_engine/properties', |
| 11 | 'recipe_engine/python', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 12 | 'recipe_engine/step', |
Eric Boren | 6441a46 | 2017-01-13 13:37:53 -0500 | [diff] [blame] | 13 | 'skia-recipes/core', |
| 14 | 'skia-recipes/run', |
| 15 | 'skia-recipes/vars', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 16 | ] |
| 17 | |
| 18 | |
| 19 | TEST_BUILDERS = { |
| 20 | 'client.skia.fyi': { |
| 21 | 'skiabot-linux-housekeeper-000': [ |
| 22 | 'Housekeeper-PerCommit', |
| 23 | 'Housekeeper-PerCommit-Trybot', |
| 24 | ], |
| 25 | }, |
| 26 | } |
| 27 | |
| 28 | |
| 29 | def RunSteps(api): |
| 30 | # Checkout, compile, etc. |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 31 | api.core.setup() |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 32 | |
| 33 | cwd = api.path['checkout'] |
| 34 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 35 | # TODO(borenet): Detect static initializers? |
| 36 | |
borenet | c549212 | 2016-09-20 13:32:37 -0700 | [diff] [blame] | 37 | gsutil_path = api.path['depot_tools'].join('gsutil.py') |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 38 | if not api.vars.is_trybot: |
| 39 | api.run( |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 40 | api.step, |
| 41 | 'generate and upload doxygen', |
borenet | 777ee88 | 2016-10-04 13:23:57 -0700 | [diff] [blame] | 42 | cmd=['python', api.core.resource('generate_and_upload_doxygen.py')], |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 43 | cwd=cwd, |
| 44 | abort_on_failure=False) |
| 45 | |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 46 | cmd = ['python', api.core.resource('run_binary_size_analysis.py'), |
| 47 | '--library', api.vars.skia_out.join( |
| 48 | 'Release', 'lib', 'libskia.so'), |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 49 | '--githash', api.properties['revision'], |
| 50 | '--gsutil_path', gsutil_path] |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 51 | if api.vars.is_trybot: |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 52 | cmd.extend(['--issue_number', str(api.properties['patch_issue'])]) |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 53 | api.run( |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 54 | api.step, |
| 55 | 'generate and upload binary size data', |
| 56 | cmd=cmd, |
| 57 | cwd=cwd, |
| 58 | abort_on_failure=False) |
| 59 | |
jcgregorio | 106a9ff | 2016-08-12 08:50:29 -0700 | [diff] [blame] | 60 | env = {} |
| 61 | env['GOPATH'] = api.vars.tmp_dir.join('golib') |
| 62 | extractexe = env['GOPATH'].join('bin', 'extract_comments') |
| 63 | goexe = api.vars.slave_dir.join('go', 'go', 'bin', 'go') |
| 64 | |
| 65 | # Compile extract_comments. |
| 66 | api.run( |
| 67 | api.step, |
| 68 | 'compile extract_comments', |
| 69 | cmd=[goexe, 'get', 'go.skia.org/infra/comments/go/extract_comments'], |
| 70 | cwd=cwd, |
| 71 | env=env, |
| 72 | abort_on_failure=True) |
| 73 | |
| 74 | # Run extract_comments on the gm directory. |
| 75 | api.run( |
| 76 | api.step, |
| 77 | 'run extract_comments', |
| 78 | cmd=[extractexe, '--dir', 'gm', '--dest', 'gs://skia-doc/gm/comments.json'], |
| 79 | cwd=cwd, |
| 80 | env=env, |
| 81 | abort_on_failure=True) |
| 82 | |
| 83 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 84 | def GenTests(api): |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 85 | yield ( |
| 86 | api.test('Housekeeper-PerCommit') + |
| 87 | api.properties(buildername='Housekeeper-PerCommit', |
| 88 | mastername='client.skia.fyi', |
| 89 | slavename='skiabot-linux-housekeeper-000', |
| 90 | buildnumber=5, |
Eric Boren | ad29aee | 2017-01-17 14:35:06 -0500 | [diff] [blame] | 91 | repository='https://skia.googlesource.com/skia.git', |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 92 | revision='abc123', |
| 93 | path_config='kitchen', |
| 94 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 95 | api.path.exists(api.path['start_dir']) |
| 96 | ) |
| 97 | yield ( |
| 98 | api.test('Housekeeper-PerCommit-Trybot') + |
| 99 | api.properties(buildername='Housekeeper-PerCommit', |
| 100 | mastername='client.skia.fyi', |
| 101 | slavename='skiabot-linux-housekeeper-000', |
| 102 | buildnumber=5, |
Eric Boren | ad29aee | 2017-01-17 14:35:06 -0500 | [diff] [blame] | 103 | repository='https://skia.googlesource.com/skia.git', |
Eric Boren | 22f5ef7 | 2016-12-02 11:01:33 -0500 | [diff] [blame] | 104 | revision='abc123', |
| 105 | path_config='kitchen', |
| 106 | patch_storage='gerrit', |
| 107 | nobuildbot='True', |
| 108 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 109 | api.properties.tryserver( |
| 110 | buildername='Housekeeper-PerCommit', |
| 111 | gerrit_project='skia', |
| 112 | gerrit_url='https://skia-review.googlesource.com/', |
| 113 | ) + |
| 114 | api.path.exists(api.path['start_dir']) |
| 115 | ) |