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 = [ |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 9 | 'core', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 10 | 'recipe_engine/path', |
| 11 | 'recipe_engine/properties', |
| 12 | 'recipe_engine/python', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 13 | 'recipe_engine/step', |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 14 | 'run', |
| 15 | '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 | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 35 | api.run( |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 36 | api.step, |
| 37 | 'android platform self-tests', |
| 38 | cmd=['python', |
| 39 | cwd.join('platform_tools', 'android', 'tests', 'run_all.py')], |
| 40 | cwd=cwd, |
| 41 | abort_on_failure=False) |
| 42 | |
| 43 | # TODO(borenet): Detect static initializers? |
| 44 | |
| 45 | gsutil_path = api.path['depot_tools'].join('third_party', 'gsutil', |
| 46 | 'gsutil') |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 47 | if not api.vars.is_trybot: |
| 48 | api.run( |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 49 | api.step, |
| 50 | 'generate and upload doxygen', |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 51 | cmd=['python', api.core.resource('generate_and_upload_doxygen.py'), |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 52 | gsutil_path], |
| 53 | cwd=cwd, |
| 54 | abort_on_failure=False) |
| 55 | |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 56 | cmd = ['python', api.core.resource('run_binary_size_analysis.py'), |
| 57 | '--library', api.vars.skia_out.join( |
| 58 | 'Release', 'lib', 'libskia.so'), |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 59 | '--githash', api.properties['revision'], |
| 60 | '--gsutil_path', gsutil_path] |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 61 | if api.vars.is_trybot: |
| 62 | cmd.extend(['--issue_number', str(api.properties['issue'])]) |
| 63 | api.run( |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 64 | api.step, |
| 65 | 'generate and upload binary size data', |
| 66 | cmd=cmd, |
| 67 | cwd=cwd, |
| 68 | abort_on_failure=False) |
| 69 | |
jcgregorio | 106a9ff | 2016-08-12 08:50:29 -0700 | [diff] [blame^] | 70 | env = {} |
| 71 | env['GOPATH'] = api.vars.tmp_dir.join('golib') |
| 72 | extractexe = env['GOPATH'].join('bin', 'extract_comments') |
| 73 | goexe = api.vars.slave_dir.join('go', 'go', 'bin', 'go') |
| 74 | |
| 75 | # Compile extract_comments. |
| 76 | api.run( |
| 77 | api.step, |
| 78 | 'compile extract_comments', |
| 79 | cmd=[goexe, 'get', 'go.skia.org/infra/comments/go/extract_comments'], |
| 80 | cwd=cwd, |
| 81 | env=env, |
| 82 | abort_on_failure=True) |
| 83 | |
| 84 | # Run extract_comments on the gm directory. |
| 85 | api.run( |
| 86 | api.step, |
| 87 | 'run extract_comments', |
| 88 | cmd=[extractexe, '--dir', 'gm', '--dest', 'gs://skia-doc/gm/comments.json'], |
| 89 | cwd=cwd, |
| 90 | env=env, |
| 91 | abort_on_failure=True) |
| 92 | |
| 93 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 94 | def GenTests(api): |
| 95 | for mastername, slaves in TEST_BUILDERS.iteritems(): |
| 96 | for slavename, builders_by_slave in slaves.iteritems(): |
| 97 | for buildername in builders_by_slave: |
| 98 | test = ( |
| 99 | api.test(buildername) + |
| 100 | api.properties(buildername=buildername, |
| 101 | mastername=mastername, |
| 102 | slavename=slavename, |
| 103 | buildnumber=5, |
| 104 | revision='abc123', |
| 105 | path_config='kitchen', |
| 106 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 107 | api.path.exists(api.path['slave_build']) |
| 108 | ) |
| 109 | if 'Trybot' in buildername: |
| 110 | test.properties['issue'] = '500' |
borenet | 1436a09 | 2016-08-03 08:23:10 -0700 | [diff] [blame] | 111 | test.properties['patchset'] = '1' |
| 112 | test.properties['rietveld'] = 'https://codereview.chromium.org' |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 113 | yield test |