OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 """Recipe for the Skia RecreateSKPs Bot.""" | 6 """Recipe for the Skia RecreateSKPs Bot.""" |
7 | 7 |
8 | 8 |
9 DEPS = [ | 9 DEPS = [ |
10 'build/file', | 10 'build/file', |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 os.rename(token_file, os.path.join(home, TOKEN_FILE_BACKUP)) | 61 os.rename(token_file, os.path.join(home, TOKEN_FILE_BACKUP)) |
62 | 62 |
63 with open(token_file, 'w') as f: | 63 with open(token_file, 'w') as f: |
64 f.write(contents) | 64 f.write(contents) |
65 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, | 65 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, |
66 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP, | 66 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP, |
67 self._key), | 67 self._key), |
68 ) | 68 ) |
69 | 69 |
70 def __exit__(self, t, v, tb): | 70 def __exit__(self, t, v, tb): |
71 return self.m.python.inline( | 71 self.m.python.inline( |
72 'depot-tools-auth logout', | 72 'depot-tools-auth logout', |
73 """ | 73 """ |
74 import os | 74 import os |
75 | 75 |
76 | 76 |
77 TOKEN_FILE = '%s' | 77 TOKEN_FILE = '%s' |
78 TOKEN_FILE_BACKUP = '%s' | 78 TOKEN_FILE_BACKUP = '%s' |
79 | 79 |
80 | 80 |
81 home = os.path.expanduser('~') | 81 home = os.path.expanduser('~') |
82 token_file = os.path.join(home, TOKEN_FILE) | 82 token_file = os.path.join(home, TOKEN_FILE) |
83 if os.path.isfile(token_file): | 83 if os.path.isfile(token_file): |
84 os.remove(token_file) | 84 os.remove(token_file) |
85 | 85 |
86 backup_file = os.path.join(home, TOKEN_FILE_BACKUP) | 86 backup_file = os.path.join(home, TOKEN_FILE_BACKUP) |
87 if os.path.isfile(backup_file): | 87 if os.path.isfile(backup_file): |
88 os.rename(backup_file, token_file) | 88 os.rename(backup_file, token_file) |
89 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, | 89 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, |
90 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP), | 90 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP), |
91 ) | 91 ) |
| 92 return v is None |
92 | 93 |
93 | 94 |
94 def RunSteps(api): | 95 def RunSteps(api): |
95 # Check out Chrome. | 96 # Check out Chrome. |
96 api.core.setup() | 97 api.core.setup() |
97 | 98 |
98 src_dir = api.vars.checkout_root.join('src') | 99 src_dir = api.vars.checkout_root.join('src') |
99 out_dir = src_dir.join('out', 'Release') | 100 out_dir = src_dir.join('out', 'Release') |
100 | 101 |
101 # Call GN. | 102 # Call GN. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 '--target_dir', output_dir] | 144 '--target_dir', output_dir] |
144 env.update(api.infra.go_env) | 145 env.update(api.infra.go_env) |
145 with depot_tools_auth(api, UPDATE_SKPS_KEY): | 146 with depot_tools_auth(api, UPDATE_SKPS_KEY): |
146 api.step('Upload SKPs', | 147 api.step('Upload SKPs', |
147 cmd=cmd, | 148 cmd=cmd, |
148 cwd=api.vars.skia_dir, | 149 cwd=api.vars.skia_dir, |
149 env=env) | 150 env=env) |
150 | 151 |
151 | 152 |
152 def GenTests(api): | 153 def GenTests(api): |
153 for mastername, slaves in TEST_BUILDERS.iteritems(): | 154 mastername = 'client.skia.compile' |
154 for slavename, builders_by_slave in slaves.iteritems(): | 155 slavename = 'skiabot-linux-swarm-000' |
155 for builder in builders_by_slave: | 156 builder = 'Housekeeper-Nightly-RecreateSKPs_Canary' |
156 test = ( | 157 yield ( |
157 api.test(builder) + | 158 api.test(builder) + |
158 api.properties(buildername=builder, | 159 api.properties(buildername=builder, |
159 mastername=mastername, | 160 mastername=mastername, |
160 slavename=slavename, | 161 slavename=slavename, |
161 revision='abc123', | 162 revision='abc123', |
162 buildnumber=2, | 163 buildnumber=2, |
163 path_config='kitchen', | 164 path_config='kitchen', |
164 swarm_out_dir='[SWARM_OUT_DIR]') + | 165 swarm_out_dir='[SWARM_OUT_DIR]') + |
165 api.path.exists(api.path['slave_build'].join('skp_output')) | 166 api.path.exists(api.path['slave_build'].join('skp_output')) |
166 ) | 167 ) |
167 yield test | 168 |
| 169 builder = 'Housekeeper-Weekly-RecreateSKPs' |
| 170 yield ( |
| 171 api.test(builder) + |
| 172 api.properties(buildername=builder, |
| 173 mastername=mastername, |
| 174 slavename=slavename, |
| 175 revision='abc123', |
| 176 buildnumber=2, |
| 177 path_config='kitchen', |
| 178 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 179 api.path.exists(api.path['slave_build'].join('skp_output')) |
| 180 ) |
| 181 |
| 182 yield ( |
| 183 api.test('failed_upload') + |
| 184 api.properties(buildername=builder, |
| 185 mastername=mastername, |
| 186 slavename=slavename, |
| 187 revision='abc123', |
| 188 buildnumber=2, |
| 189 path_config='kitchen', |
| 190 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 191 api.path.exists(api.path['slave_build'].join('skp_output')) + |
| 192 api.step_data('Upload SKPs', retcode=1) |
| 193 ) |
OLD | NEW |