blob: 43e694c3843e8069ac5f3956795cd63365081f56 [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 = [
borenet1436a092016-08-03 08:23:10 -07009 'core',
borenet1ed2ae42016-07-26 11:52:17 -070010 'recipe_engine/path',
11 'recipe_engine/properties',
12 'recipe_engine/python',
borenet1ed2ae42016-07-26 11:52:17 -070013 'recipe_engine/step',
borenet1436a092016-08-03 08:23:10 -070014 'run',
15 '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
borenet1436a092016-08-03 08:23:10 -070035 api.run(
borenet1ed2ae42016-07-26 11:52:17 -070036 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')
borenet1436a092016-08-03 08:23:10 -070047 if not api.vars.is_trybot:
48 api.run(
borenet1ed2ae42016-07-26 11:52:17 -070049 api.step,
50 'generate and upload doxygen',
borenet1436a092016-08-03 08:23:10 -070051 cmd=['python', api.core.resource('generate_and_upload_doxygen.py'),
borenet1ed2ae42016-07-26 11:52:17 -070052 gsutil_path],
53 cwd=cwd,
54 abort_on_failure=False)
55
borenet1436a092016-08-03 08:23:10 -070056 cmd = ['python', api.core.resource('run_binary_size_analysis.py'),
57 '--library', api.vars.skia_out.join(
58 'Release', 'lib', 'libskia.so'),
borenet1ed2ae42016-07-26 11:52:17 -070059 '--githash', api.properties['revision'],
60 '--gsutil_path', gsutil_path]
borenet1436a092016-08-03 08:23:10 -070061 if api.vars.is_trybot:
62 cmd.extend(['--issue_number', str(api.properties['issue'])])
63 api.run(
borenet1ed2ae42016-07-26 11:52:17 -070064 api.step,
65 'generate and upload binary size data',
66 cmd=cmd,
67 cwd=cwd,
68 abort_on_failure=False)
69
jcgregorio106a9ff2016-08-12 08:50:29 -070070 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
borenet1ed2ae42016-07-26 11:52:17 -070094def 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'
borenet1436a092016-08-03 08:23:10 -0700111 test.properties['patchset'] = '1'
112 test.properties['rietveld'] = 'https://codereview.chromium.org'
borenet1ed2ae42016-07-26 11:52:17 -0700113 yield test