Index: scripts/slave/recipe_modules/chromium_tests/api.py |
diff --git a/scripts/slave/recipe_modules/chromium_tests/api.py b/scripts/slave/recipe_modules/chromium_tests/api.py |
index 862b71586d1098dab5624d16387ccbaed62d37bb..19653dbe102e572c48e8d05f640995ae81ff6daa 100644 |
--- a/scripts/slave/recipe_modules/chromium_tests/api.py |
+++ b/scripts/slave/recipe_modules/chromium_tests/api.py |
@@ -2,7 +2,6 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import collections |
import contextlib |
import copy |
import itertools |
@@ -25,24 +24,6 @@ RECIPE_CONFIG_PATHS = [ |
] |
-PER_TARGET_SWARMING_DIMS = collections.defaultdict(dict) |
-PER_TARGET_SWARMING_DIMS.update({ |
- 'android': { |
- 'android_devices': '6', |
- 'cpu': None, |
- 'gpu': None, |
- 'os': 'Android', |
- } |
-}) |
- |
- |
-MASTER_SWARMING_PRIORITIES = collections.defaultdict(lambda: 25) |
-MASTER_SWARMING_PRIORITIES.update({ |
- 'chromium.fyi': 35, # This should be lower than the CQ. |
- 'chromium.memory.fyi': 27, |
-}) |
- |
- |
class ChromiumTestsApi(recipe_api.RecipeApi): |
def __init__(self, *args, **kwargs): |
super(ChromiumTestsApi, self).__init__(*args, **kwargs) |
@@ -725,49 +706,10 @@ class ChromiumTestsApi(recipe_api.RecipeApi): |
return self.m.filter.test_targets, compile_targets |
+ # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. |
def configure_swarming(self, project_name, precommit, mastername=None): |
- """Configures default swarming dimensions and tags. |
- |
- Uses the 'chromium' global config to determine target platform defaults, |
- make sure something like chromium_tests.configure_build() has been called |
- beforehand. |
- |
- Args: |
- project_name: Lowercase name of the project, e.g. "blink", "chromium". |
- precommit: Boolean flag to indicate whether the tests are running before |
- the changes are commited. |
- """ |
- |
- # Set platform-specific default dims. |
- target_platform = self.m.chromium.c.TARGET_PLATFORM |
- swarming_dims = PER_TARGET_SWARMING_DIMS[target_platform] |
- for k, v in swarming_dims.iteritems(): |
- self.m.swarming.set_default_dimension(k, v) |
- |
- self.m.swarming.set_default_dimension('pool', 'Chrome') |
- self.m.swarming.add_default_tag('project:%s' % project_name) |
- self.m.swarming.default_idempotent = True |
- |
- if precommit: |
- self.m.swarming.default_priority = 30 |
- self.m.swarming.add_default_tag('purpose:pre-commit') |
- requester = self.m.properties.get('requester') |
- if requester == 'commit-bot@chromium.org': |
- self.m.swarming.add_default_tag('purpose:CQ') |
- blamelist = self.m.properties.get('blamelist') |
- if len(blamelist) == 1: |
- requester = blamelist[0] |
- else: |
- self.m.swarming.add_default_tag('purpose:ManualTS') |
- self.m.swarming.default_user = requester |
- |
- patch_project = self.m.properties.get('patch_project') |
- if patch_project: |
- self.m.swarming.add_default_tag('patch_project:%s' % patch_project) |
- else: |
- self.m.swarming.default_priority = MASTER_SWARMING_PRIORITIES[mastername] |
- self.m.swarming.add_default_tag('purpose:post-commit') |
- self.m.swarming.add_default_tag('purpose:CI') |
+ return self.m.chromium_swarming.configure_swarming( # pragma: no cover |
+ project_name, precommit, mastername) |
def _build_gs_archive_url(self, mastername, master_config, buildername): |
"""Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |