Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: scripts/slave/recipe_modules/skia/api.py

Issue 1862713002: Convert Coverage flavor and bot to Swarming (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: Rename Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import json 6 import json
7 import os 7 import os
8 import re 8 import re
9 import sys 9 import sys
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if self.running_in_swarming: 192 if self.running_in_swarming:
193 self.swarming_out_dir = self.m.properties['swarm_out_dir'] 193 self.swarming_out_dir = self.m.properties['swarm_out_dir']
194 self.out_dir = self.slave_dir.join('out') 194 self.out_dir = self.slave_dir.join('out')
195 self.local_skp_dir = self.slave_dir.join('skps') 195 self.local_skp_dir = self.slave_dir.join('skps')
196 else: 196 else:
197 self.out_dir = self.m.path['checkout'].join('out', self.builder_name) 197 self.out_dir = self.m.path['checkout'].join('out', self.builder_name)
198 self.local_skp_dir = self.slave_dir.join('playback', 'skps') 198 self.local_skp_dir = self.slave_dir.join('playback', 'skps')
199 self.tmp_dir = self.m.path['slave_build'].join('tmp') 199 self.tmp_dir = self.m.path['slave_build'].join('tmp')
200 200
201 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) 201 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM)
202 # TODO(borenet): This works on GCE instance because we fall back on
203 # service account auth. What about our local bots?
204 self.gsutil_env_skia_infra = self.gsutil_env(None)
205 202
206 self.device_dirs = None 203 self.device_dirs = None
207 self._ccache = None 204 self._ccache = None
208 self._checked_for_ccache = False 205 self._checked_for_ccache = False
209 self.configuration = self.builder_spec['configuration'] 206 self.configuration = self.builder_spec['configuration']
210 self.default_env.update({'SKIA_OUT': self.out_dir, 207 self.default_env.update({'SKIA_OUT': self.out_dir,
211 'BUILDTYPE': self.configuration}) 208 'BUILDTYPE': self.configuration})
212 self.default_env.update(self.builder_spec['env']) 209 self.default_env.update(self.builder_spec['env'])
213 self.build_targets = [str(t) for t in self.builder_spec['build_targets']] 210 self.build_targets = [str(t) for t in self.builder_spec['build_targets']]
214 if 'Android' in self.builder_name and self.running_in_swarming: 211 if 'Android' in self.builder_name and self.running_in_swarming:
215 # TODO(borenet): Make the app build work on Swarming and remove this. 212 # TODO(borenet): Make the app build work on Swarming and remove this.
216 self.build_targets = ['dm', 'nanobench'] 213 self.build_targets = ['dm', 'nanobench']
214 self.do_compile_steps = self.builder_spec.get('do_compile_steps', True)
217 self.do_test_steps = self.builder_spec['do_test_steps'] 215 self.do_test_steps = self.builder_spec['do_test_steps']
218 self.do_perf_steps = self.builder_spec['do_perf_steps'] 216 self.do_perf_steps = self.builder_spec['do_perf_steps']
219 self.is_trybot = self.builder_cfg['is_trybot'] 217 self.is_trybot = self.builder_cfg['is_trybot']
220 self.upload_dm_results = self.builder_spec['upload_dm_results'] 218 self.upload_dm_results = self.builder_spec['upload_dm_results']
221 self.upload_perf_results = self.builder_spec['upload_perf_results'] 219 self.upload_perf_results = self.builder_spec['upload_perf_results']
222 if self.running_in_swarming: 220 if self.running_in_swarming:
223 self.dm_dir = self.m.path.join( 221 self.dm_dir = self.m.path.join(
224 self.swarming_out_dir, 'dm') 222 self.swarming_out_dir, 'dm')
225 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, 223 self.perf_data_dir = self.m.path.join(self.swarming_out_dir,
226 'perfdata', self.builder_name, 'data') 224 'perfdata', self.builder_name, 'data')
227 else: 225 else:
228 self.dm_dir = self.slave_dir.join('dm') 226 self.dm_dir = self.slave_dir.join('dm')
229 self.perf_data_dir = self.slave_dir.join('perfdata', self.builder_name, 227 self.perf_data_dir = self.slave_dir.join('perfdata', self.builder_name,
230 'data') 228 'data')
231 self.dm_flags = self.builder_spec['dm_flags'] 229 self.dm_flags = self.builder_spec['dm_flags']
232 self.nanobench_flags = self.builder_spec['nanobench_flags'] 230 self.nanobench_flags = self.builder_spec['nanobench_flags']
233 231
234 self.flavor = self.get_flavor(self.builder_cfg) 232 self.flavor = self.get_flavor(self.builder_cfg)
235 233
236 def run_steps(self): 234 def run_steps(self):
237 """Compile, run tests, perf, etc.""" 235 """Compile, run tests, perf, etc."""
238 self.compile_steps() 236 if self.do_compile_steps:
237 self.compile_steps()
239 if self.do_test_steps: 238 if self.do_test_steps:
240 self.test_steps() 239 self.test_steps()
241 if self.do_perf_steps: 240 if self.do_perf_steps:
242 self.perf_steps() 241 self.perf_steps()
243 242
244 if self.do_test_steps or self.do_perf_steps: 243 if self.do_test_steps or self.do_perf_steps:
245 self.cleanup_steps() 244 self.cleanup_steps()
246 245
247 if self.failed: 246 if self.failed:
248 raise self.m.step.StepFailure('Failed build steps: %s' % 247 raise self.m.step.StepFailure('Failed build steps: %s' %
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 env = dict(env or {}) 387 env = dict(env or {})
389 env.update(self.default_env) 388 env.update(self.default_env)
390 try: 389 try:
391 return steptype(name=name, env=env, **kwargs) 390 return steptype(name=name, env=env, **kwargs)
392 except self.m.step.StepFailure as e: 391 except self.m.step.StepFailure as e:
393 if abort_on_failure: 392 if abort_on_failure:
394 raise # pragma: no cover 393 raise # pragma: no cover
395 if fail_build_on_failure: 394 if fail_build_on_failure:
396 self.failed.append(e) 395 self.failed.append(e)
397 396
398 def gsutil_upload(self, name, source, bucket, dest):
399 """Upload to Google Storage without using a .boto file."""
400 self.run(
401 self.m.gsutil.upload,
402 name,
403 source=source,
404 bucket=bucket,
405 dest=dest,
406 args=['-R'],
407 env=self.gsutil_env_skia_infra,
408 abort_on_failure=False)
409
410 def download_dir(self, version_file, gs_path_tmpl, tmp_dir, host_path, 397 def download_dir(self, version_file, gs_path_tmpl, tmp_dir, host_path,
411 test_expected_version, test_actual_version, 398 test_expected_version, test_actual_version,
412 running_in_swarming): 399 running_in_swarming):
413 """Download the given directory from Google Storage if necessary. 400 """Download the given directory from Google Storage if necessary.
414 401
415 Return the downloaded version. 402 Return the downloaded version.
416 """ 403 """
417 actual_version_file = self.m.path.join(tmp_dir, version_file) 404 actual_version_file = self.m.path.join(tmp_dir, version_file)
418 # If we're running as a Swarming task, we should've received the test inputs 405 # If we're running as a Swarming task, we should've received the test inputs
419 # via the isolate server. Only download if we're not running in Swarming. 406 # via the isolate server. Only download if we're not running in Swarming.
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 # Don't bother to include role, which is always Test. 856 # Don't bother to include role, which is always Test.
870 # TryBots are uploaded elsewhere so they can use the same key. 857 # TryBots are uploaded elsewhere so they can use the same key.
871 blacklist = ['role', 'is_trybot'] 858 blacklist = ['role', 'is_trybot']
872 859
873 flat = [] 860 flat = []
874 for k in sorted(self.builder_cfg.keys()): 861 for k in sorted(self.builder_cfg.keys()):
875 if k not in blacklist: 862 if k not in blacklist:
876 flat.append(k) 863 flat.append(k)
877 flat.append(self.builder_cfg[k]) 864 flat.append(self.builder_cfg[k])
878 return flat 865 return flat
OLDNEW
« no previous file with comments | « masters/master.client.skia/slaves.cfg ('k') | scripts/slave/recipe_modules/skia/coverage_flavor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698