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

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

Issue 1185693002: Move builders.py and steps.py to chromium_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Add builders property to chromium_tests test_api. Created 5 years, 6 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 import contextlib 5 import contextlib
6 import copy 6 import copy
7 import json 7 import json
8 8
9 from infra.libs.infra_types import freeze, thaw 9 from infra.libs.infra_types import freeze, thaw
10 from recipe_engine import recipe_api 10 from recipe_engine import recipe_api
11 from recipe_engine import util as recipe_util 11 from recipe_engine import util as recipe_util
12 12
13 from . import builders
14 from . import steps
15
13 16
14 class ChromiumTestsApi(recipe_api.RecipeApi): 17 class ChromiumTestsApi(recipe_api.RecipeApi):
18 def __init__(self, *args, **kwargs):
19 super(ChromiumTestsApi, self).__init__(*args, **kwargs)
20
21 @property
22 def steps(self):
23 return steps
24
25 def load_builder_configs(self, mastername):
Paweł Hajdan Jr. 2015/06/15 09:09:29 Why do we need this method? Wasn't this done impli
Adrian Kuegel 2015/06/15 12:33:22 As we discussed offline, I will preserve what we c
26 self.m.chromium.add_builders({mastername: builders.BUILDERS[mastername]})
Paweł Hajdan Jr. 2015/06/15 09:09:29 Do we still need chromium.add_builders? Do you pla
Adrian Kuegel 2015/06/15 12:33:22 I guess it makes sense to move also the builders p
27
15 def configure_build(self, mastername, buildername, override_bot_type=None, 28 def configure_build(self, mastername, buildername, override_bot_type=None,
16 ): 29 ):
17 master_dict = self.m.chromium.builders.get(mastername, {}) 30 master_dict = self.m.chromium.builders.get(mastername, {})
18 bot_config = master_dict.get('builders', {}).get(buildername) 31 bot_config = master_dict.get('builders', {}).get(buildername)
19 32
20 # Get the buildspec version. It can be supplied as a build property or as 33 # Get the buildspec version. It can be supplied as a build property or as
21 # a recipe config value. 34 # a recipe config value.
22 buildspec_version = (self.m.properties.get('buildspec_version') or 35 buildspec_version = (self.m.properties.get('buildspec_version') or
23 bot_config.get('buildspec_version')) 36 bot_config.get('buildspec_version'))
24 37
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 build_archive_url=specified_url) 407 build_archive_url=specified_url)
395 408
396 if (self.m.chromium.c.TARGET_PLATFORM == 'android' and 409 if (self.m.chromium.c.TARGET_PLATFORM == 'android' and
397 bot_config.get('root_devices')): 410 bot_config.get('root_devices')):
398 self.m.adb.root_devices() 411 self.m.adb.root_devices()
399 412
400 # TODO(shinyak): bot_config.get('tests', []) sometimes return tuple. 413 # TODO(shinyak): bot_config.get('tests', []) sometimes return tuple.
401 tests = list(bot_config.get('tests', [])) 414 tests = list(bot_config.get('tests', []))
402 415
403 if bot_config.get('goma_canary'): 416 if bot_config.get('goma_canary'):
404 tests.insert(0, self.m.chromium.steps.DiagnoseGomaTest()) 417 tests.insert(0, steps.DiagnoseGomaTest())
405 418
406 if bot_type in ('tester', 'builder_tester'): 419 if bot_type in ('tester', 'builder_tester'):
407 isolated_targets = [t.isolate_target for t in tests if t.uses_swarming] 420 isolated_targets = [t.isolate_target for t in tests if t.uses_swarming]
408 if isolated_targets: 421 if isolated_targets:
409 self.m.isolate.find_isolated_tests(self.m.chromium.output_dir) 422 self.m.isolate.find_isolated_tests(self.m.chromium.output_dir)
410 423
411 return tests 424 return tests
412 425
413 def _make_legacy_build_url(self, master_config, mastername): 426 def _make_legacy_build_url(self, master_config, mastername):
414 return self.m.archive.legacy_download_url( 427 return self.m.archive.legacy_download_url(
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 master_config.get('build_gs_bucket'), 624 master_config.get('build_gs_bucket'),
612 extra_url_components=None) 625 extra_url_components=None)
613 elif (mastername == 'tryserver.chromium.perf' or 626 elif (mastername == 'tryserver.chromium.perf' or
614 (mastername == 'tryserver.chromium.linux' and 627 (mastername == 'tryserver.chromium.linux' and
615 buildername == 'linux_full_bisect_builder')): 628 buildername == 'linux_full_bisect_builder')):
616 return None 629 return None
617 else: 630 else:
618 return self.m.archive.legacy_upload_url( 631 return self.m.archive.legacy_upload_url(
619 master_config.get('build_gs_bucket'), 632 master_config.get('build_gs_bucket'),
620 extra_url_components=self.m.properties['mastername']) 633 extra_url_components=self.m.properties['mastername'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698