blob: 630ef45b90d7580889695ce5bf81295f02c6a83b [file] [log] [blame]
borenet1ed2ae42016-07-26 11:52:17 -07001# 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
borenet1ed2ae42016-07-26 11:52:17 -07008DEPS = [
9 'recipe_engine/path',
10 'recipe_engine/properties',
11 'recipe_engine/python',
borenet1ed2ae42016-07-26 11:52:17 -070012 'recipe_engine/step',
Eric Boren6441a462017-01-13 13:37:53 -050013 'skia-recipes/core',
14 'skia-recipes/run',
15 'skia-recipes/vars',
borenet1ed2ae42016-07-26 11:52:17 -070016]
17
18
19TEST_BUILDERS = {
20 'client.skia.fyi': {
21 'skiabot-linux-housekeeper-000': [
22 'Housekeeper-PerCommit',
23 'Housekeeper-PerCommit-Trybot',
24 ],
25 },
26}
27
28
29def RunSteps(api):
30 # Checkout, compile, etc.
borenet1436a092016-08-03 08:23:10 -070031 api.core.setup()
borenet1ed2ae42016-07-26 11:52:17 -070032
33 cwd = api.path['checkout']
34
borenet1ed2ae42016-07-26 11:52:17 -070035 # TODO(borenet): Detect static initializers?
36
borenetc5492122016-09-20 13:32:37 -070037 gsutil_path = api.path['depot_tools'].join('gsutil.py')
borenet1436a092016-08-03 08:23:10 -070038 if not api.vars.is_trybot:
39 api.run(
borenet1ed2ae42016-07-26 11:52:17 -070040 api.step,
41 'generate and upload doxygen',
borenet777ee882016-10-04 13:23:57 -070042 cmd=['python', api.core.resource('generate_and_upload_doxygen.py')],
borenet1ed2ae42016-07-26 11:52:17 -070043 cwd=cwd,
44 abort_on_failure=False)
45
borenet1436a092016-08-03 08:23:10 -070046 cmd = ['python', api.core.resource('run_binary_size_analysis.py'),
47 '--library', api.vars.skia_out.join(
48 'Release', 'lib', 'libskia.so'),
borenet1ed2ae42016-07-26 11:52:17 -070049 '--githash', api.properties['revision'],
50 '--gsutil_path', gsutil_path]
borenet1436a092016-08-03 08:23:10 -070051 if api.vars.is_trybot:
Eric Boren22f5ef72016-12-02 11:01:33 -050052 cmd.extend(['--issue_number', str(api.properties['patch_issue'])])
borenet1436a092016-08-03 08:23:10 -070053 api.run(
borenet1ed2ae42016-07-26 11:52:17 -070054 api.step,
55 'generate and upload binary size data',
56 cmd=cmd,
57 cwd=cwd,
58 abort_on_failure=False)
59
jcgregorio106a9ff2016-08-12 08:50:29 -070060 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
borenet1ed2ae42016-07-26 11:52:17 -070084def GenTests(api):
Eric Boren22f5ef72016-12-02 11:01:33 -050085 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 Borenad29aee2017-01-17 14:35:06 -050091 repository='https://skia.googlesource.com/skia.git',
Eric Boren22f5ef72016-12-02 11:01:33 -050092 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 Borenad29aee2017-01-17 14:35:06 -0500103 repository='https://skia.googlesource.com/skia.git',
Eric Boren22f5ef72016-12-02 11:01:33 -0500104 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 )