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

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

Issue 2319853002: Remove ignored bot_update "force" parameter. (Closed)
Patch Set: rebase Created 4 years, 3 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 collections 5 import collections
6 import contextlib 6 import contextlib
7 import copy 7 import copy
8 import itertools 8 import itertools
9 import json 9 import json
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 component_rev = self.m.properties.get( 165 component_rev = self.m.properties.get(
166 'parent_got_revision', component_rev) 166 'parent_got_revision', component_rev)
167 dep = bot_config.get('set_component_rev') 167 dep = bot_config.get('set_component_rev')
168 self.m.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev 168 self.m.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev
169 169
170 # TODO(phajdan.jr): fix callers and remove chromium_tests.get_checkout_dir. 170 # TODO(phajdan.jr): fix callers and remove chromium_tests.get_checkout_dir.
171 def get_checkout_dir(self, bot_config): # pragma: no cover 171 def get_checkout_dir(self, bot_config): # pragma: no cover
172 return self.m.chromium_checkout.get_checkout_dir(bot_config) 172 return self.m.chromium_checkout.get_checkout_dir(bot_config)
173 173
174 # TODO(phajdan.jr): fix callers and remove chromium_tests.ensure_checkout. 174 # TODO(phajdan.jr): fix callers and remove chromium_tests.ensure_checkout.
175 def ensure_checkout(self, bot_config, root_solution_revision=None, 175 def ensure_checkout(self, bot_config, root_solution_revision=None):
176 force=False):
177 return self.m.chromium_checkout.ensure_checkout( # pragma: no cover 176 return self.m.chromium_checkout.ensure_checkout( # pragma: no cover
178 bot_config, root_solution_revision, force) 177 bot_config, root_solution_revision, force)
179 178
180 def set_up_swarming(self, bot_config): 179 def set_up_swarming(self, bot_config):
181 if not bot_config.get('enable_swarming'): 180 if not bot_config.get('enable_swarming'):
182 return 181 return
183 self.m.isolate.set_isolate_environment(self.m.chromium.c) 182 self.m.isolate.set_isolate_environment(self.m.chromium.c)
184 self.m.swarming.check_client_version() 183 self.m.swarming.check_client_version()
185 for key, value in bot_config.get('swarming_dimensions', {}).iteritems(): 184 for key, value in bot_config.get('swarming_dimensions', {}).iteritems():
186 self.m.swarming.set_default_dimension(key, value) 185 self.m.swarming.set_default_dimension(key, value)
(...skipping 10 matching lines...) Expand all
197 self.m.chromium.runhooks() 196 self.m.chromium.runhooks()
198 197
199 # TODO(phajdan.jr): remove create_bot_db_from_master_dict. It adds another 198 # TODO(phajdan.jr): remove create_bot_db_from_master_dict. It adds another
200 # entry point to _add_master_dict_and_test_spec which can really complicate 199 # entry point to _add_master_dict_and_test_spec which can really complicate
201 # things. 200 # things.
202 def create_bot_db_from_master_dict(self, mastername, master_dict): 201 def create_bot_db_from_master_dict(self, mastername, master_dict):
203 bot_db = bdb_module.BotConfigAndTestDB() 202 bot_db = bdb_module.BotConfigAndTestDB()
204 bot_db._add_master_dict_and_test_spec(mastername, master_dict, {}) 203 bot_db._add_master_dict_and_test_spec(mastername, master_dict, {})
205 return bot_db 204 return bot_db
206 205
207 def prepare_checkout(self, bot_config, root_solution_revision=None, 206 def prepare_checkout(self, bot_config, root_solution_revision=None):
208 force=False):
209 update_step = self.m.chromium_checkout.ensure_checkout( 207 update_step = self.m.chromium_checkout.ensure_checkout(
210 bot_config, root_solution_revision, force=force) 208 bot_config, root_solution_revision)
211 209
212 if (self.m.chromium.c.compile_py.compiler and 210 if (self.m.chromium.c.compile_py.compiler and
213 'goma' in self.m.chromium.c.compile_py.compiler): 211 'goma' in self.m.chromium.c.compile_py.compiler):
214 self.m.chromium.ensure_goma(canary=bot_config.get('goma_canary', False)) 212 self.m.chromium.ensure_goma(canary=bot_config.get('goma_canary', False))
215 213
216 self.set_up_swarming(bot_config) 214 self.set_up_swarming(bot_config)
217 self.runhooks(update_step) 215 self.runhooks(update_step)
218 216
219 bot_db = bdb_module.BotConfigAndTestDB() 217 bot_db = bdb_module.BotConfigAndTestDB()
220 bot_config.initialize_bot_db(self, bot_db, update_step) 218 bot_config.initialize_bot_db(self, bot_db, update_step)
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 675
678 kwargs = {} 676 kwargs = {}
679 if self.m.chromium_checkout.working_dir: 677 if self.m.chromium_checkout.working_dir:
680 kwargs['cwd'] = self.m.chromium_checkout.working_dir 678 kwargs['cwd'] = self.m.chromium_checkout.working_dir
681 679
682 # TODO(tandrii): remove this per http://crbug.com/635641. 680 # TODO(tandrii): remove this per http://crbug.com/635641.
683 if self.m.platform.is_linux: 681 if self.m.platform.is_linux:
684 kwargs['env'] = {'GCLIENT_KILL_GIT_FETCH_AFTER': '1200'} # 20 minutes. 682 kwargs['env'] = {'GCLIENT_KILL_GIT_FETCH_AFTER': '1200'} # 20 minutes.
685 683
686 self.m.bot_update.ensure_checkout( 684 self.m.bot_update.ensure_checkout(
687 force=True, patch=False, update_presentation=False, **kwargs) 685 patch=False, update_presentation=False, **kwargs)
688 self.m.chromium.runhooks(name='runhooks (without patch)') 686 self.m.chromium.runhooks(name='runhooks (without patch)')
689 687
690 def run_tests_on_tryserver(self, bot_config, api, tests, bot_update_step, 688 def run_tests_on_tryserver(self, bot_config, api, tests, bot_update_step,
691 affected_files, mb_mastername=None, 689 affected_files, mb_mastername=None,
692 mb_buildername=None): 690 mb_buildername=None):
693 def deapply_patch_fn(failing_tests): 691 def deapply_patch_fn(failing_tests):
694 self.deapply_patch(bot_update_step) 692 self.deapply_patch(bot_update_step)
695 compile_targets = list(itertools.chain( 693 compile_targets = list(itertools.chain(
696 *[t.compile_targets(api) for t in failing_tests])) 694 *[t.compile_targets(api) for t in failing_tests]))
697 if compile_targets: 695 if compile_targets:
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 # chromium_tests, and currently recipe engine does not set up 822 # chromium_tests, and currently recipe engine does not set up
825 # self-reference self.m.chromium_tests in chromium_tests. 823 # self-reference self.m.chromium_tests in chromium_tests.
826 def main_waterfall_steps(api): 824 def main_waterfall_steps(api):
827 mastername = api.properties.get('mastername') 825 mastername = api.properties.get('mastername')
828 buildername = api.properties.get('buildername') 826 buildername = api.properties.get('buildername')
829 827
830 bot_config = api.chromium_tests.create_bot_config_object( 828 bot_config = api.chromium_tests.create_bot_config_object(
831 mastername, buildername) 829 mastername, buildername)
832 api.chromium_tests.configure_build(bot_config) 830 api.chromium_tests.configure_build(bot_config)
833 update_step, bot_db = api.chromium_tests.prepare_checkout( 831 update_step, bot_db = api.chromium_tests.prepare_checkout(
834 bot_config, force=True) 832 bot_config)
835 tests, tests_including_triggered = api.chromium_tests.get_tests( 833 tests, tests_including_triggered = api.chromium_tests.get_tests(
836 bot_config, bot_db) 834 bot_config, bot_db)
837 compile_targets = api.chromium_tests.get_compile_targets( 835 compile_targets = api.chromium_tests.get_compile_targets(
838 bot_config, bot_db, tests_including_triggered) 836 bot_config, bot_db, tests_including_triggered)
839 api.chromium_tests.compile_specific_targets( 837 api.chromium_tests.compile_specific_targets(
840 bot_config, update_step, bot_db, 838 bot_config, update_step, bot_db,
841 compile_targets, tests_including_triggered) 839 compile_targets, tests_including_triggered)
842 api.chromium_tests.archive_build( 840 api.chromium_tests.archive_build(
843 mastername, buildername, update_step, bot_db) 841 mastername, buildername, update_step, bot_db)
844 api.chromium_tests.download_and_unzip_build(mastername, buildername, 842 api.chromium_tests.download_and_unzip_build(mastername, buildername,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 targets in |compile_targets|.""" 1010 targets in |compile_targets|."""
1013 result = [] 1011 result = []
1014 for test in tests: 1012 for test in tests:
1015 test_compile_targets = test.compile_targets(api) 1013 test_compile_targets = test.compile_targets(api)
1016 # Always return tests that don't require compile. Otherwise we'd never 1014 # Always return tests that don't require compile. Otherwise we'd never
1017 # run them. 1015 # run them.
1018 if ((set(compile_targets) & set(test_compile_targets)) or 1016 if ((set(compile_targets) & set(test_compile_targets)) or
1019 not test_compile_targets): 1017 not test_compile_targets):
1020 result.append(test) 1018 result.append(test)
1021 return result 1019 return result
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/chromium_checkout/api.py ('k') | scripts/slave/recipe_modules/chromium_tests/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698