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

Side by Side Diff: scripts/slave/recipes/chromium_trybot.py

Issue 1565113003: Add concept of bot config and test spec database (BotConfigAndTestDB). (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Rebased. (Probably unnecessary.) Created 4 years, 11 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
« no previous file with comments | « scripts/slave/recipes/chromium.py ('k') | scripts/slave/recipes/findit/chromium/compile.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 6
7 from recipe_engine.types import freeze 7 from recipe_engine.types import freeze
8 8
9 DEPS = [ 9 DEPS = [
10 'amp', 10 'amp',
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 for test in tests 193 for test in tests
194 for x in test.compile_targets(api))) 194 for x in test.compile_targets(api)))
195 195
196 196
197 def is_source_file(api, filepath): 197 def is_source_file(api, filepath):
198 """Returns true iff the file is a source file.""" 198 """Returns true iff the file is a source file."""
199 _, ext = api.path.splitext(filepath) 199 _, ext = api.path.splitext(filepath)
200 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm'] 200 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm']
201 201
202 def _RunStepsInternal(api): 202 def _RunStepsInternal(api):
203 def get_bot_config(mastername, buildername): 203 def _get_bot_config(mastername, buildername):
204 master_dict = api.chromium_tests.trybots.get(mastername, {}) 204 master_dict = api.chromium_tests.trybots.get(mastername, {})
205 return master_dict.get('builders', {}).get(buildername) 205 return master_dict.get('builders', {}).get(buildername)
206 206
207 mastername = api.properties.get('mastername') 207 mastername = api.properties.get('mastername')
208 buildername = api.properties.get('buildername') 208 buildername = api.properties.get('buildername')
209 bot_config = get_bot_config(mastername, buildername) 209 bot_config = _get_bot_config(mastername, buildername)
210 210
211 # TODO(sergiyb): This is a temporary hack to run GPU tests on tryserver 211 # TODO(sergiyb): This is a temporary hack to run GPU tests on tryserver
212 # only. This should be removed when we will convert chromium.gpu waterfall 212 # only. This should be removed when we will convert chromium.gpu waterfall
213 # to swarming and be able to replicate the tests to tryserver automatically. 213 # to swarming and be able to replicate the tests to tryserver automatically.
214 master = api.properties['mastername'] 214 master = api.properties['mastername']
215 builder = api.properties['buildername'] 215 builder = api.properties['buildername']
216 enable_gpu_tests = builder in CHROMIUM_GPU_DIMENSION_SETS.get(master, {}) 216 enable_gpu_tests = builder in CHROMIUM_GPU_DIMENSION_SETS.get(master, {})
217 217
218 api.chromium_tests.configure_build( 218 api.chromium_tests.configure_build(
219 bot_config['mastername'], 219 bot_config['mastername'],
220 bot_config['buildername'], 220 bot_config['buildername'],
221 override_bot_type='builder_tester') 221 override_bot_type='builder_tester')
222 222
223 api.chromium_tests.configure_swarming('chromium', precommit=True) 223 api.chromium_tests.configure_swarming('chromium', precommit=True)
224 224
225 api.chromium.apply_config('trybot_flavor') 225 api.chromium.apply_config('trybot_flavor')
226 if enable_gpu_tests: 226 if enable_gpu_tests:
227 api.chromium.apply_config('archive_gpu_tests') 227 api.chromium.apply_config('archive_gpu_tests')
228 api.chromium.apply_config('chrome_with_codecs') 228 api.chromium.apply_config('chrome_with_codecs')
229 229
230 if api.properties.get('patch_project') == 'blink': # pragma: no cover 230 if api.properties.get('patch_project') == 'blink': # pragma: no cover
231 raise Exception('CLs which use blink project are not supported. ' 231 raise Exception('CLs which use blink project are not supported. '
232 'Please re-create the CL using fresh checkout after ' 232 'Please re-create the CL using fresh checkout after '
233 'the blink merge.') 233 'the blink merge.')
234 234
235 bot_update_step, master_dict, test_spec = \ 235 bot_update_step, bot_db = \
236 api.chromium_tests.prepare_checkout( 236 api.chromium_tests.prepare_checkout(
237 bot_config['mastername'], 237 bot_config['mastername'],
238 bot_config['buildername']) 238 bot_config['buildername'])
239 239
240 tests = list(api.chromium_tests.tests_for_builder( 240 tests = list(api.chromium_tests.tests_for_builder(
241 bot_config['mastername'], 241 bot_config['mastername'],
242 bot_config['buildername'], 242 bot_config['buildername'],
243 bot_update_step, 243 bot_update_step,
244 master_dict, 244 bot_db,
245 override_bot_type='builder_tester')) 245 override_bot_type='builder_tester'))
246 tester = bot_config.get('tester', '') 246 tester = bot_config.get('tester', '')
247 if tester: 247 if tester:
248 test_config = master_dict.get('builders', {}).get(tester) 248 test_config = bot_db.get_bot_config(bot_config['mastername'], tester)
249 for key, value in test_config.get('swarming_dimensions', {}).iteritems(): 249 for key, value in test_config.get('swarming_dimensions', {}).iteritems():
250 api.swarming.set_default_dimension(key, value) 250 api.swarming.set_default_dimension(key, value)
251 tests.extend(api.chromium_tests.tests_for_builder( 251 tests.extend(api.chromium_tests.tests_for_builder(
252 bot_config['mastername'], 252 bot_config['mastername'],
253 tester, 253 tester,
254 bot_update_step, 254 bot_update_step,
255 master_dict, 255 bot_db,
256 override_bot_type='builder_tester')) 256 override_bot_type='builder_tester'))
257 257
258 if enable_gpu_tests: 258 if enable_gpu_tests:
259 tests.extend(api.gpu.create_tests( 259 tests.extend(api.gpu.create_tests(
260 bot_update_step.presentation.properties['got_revision'], 260 bot_update_step.presentation.properties['got_revision'],
261 bot_update_step.presentation.properties['got_revision'], 261 bot_update_step.presentation.properties['got_revision'],
262 enable_swarming=True, 262 enable_swarming=True,
263 swarming_dimension_sets=CHROMIUM_GPU_DIMENSION_SETS[master][builder])) 263 swarming_dimension_sets=CHROMIUM_GPU_DIMENSION_SETS[master][builder]))
264 264
265 affected_files = api.tryserver.get_files_affected_by_patch() 265 affected_files = api.tryserver.get_files_affected_by_patch()
(...skipping 25 matching lines...) Expand all
291 api.chromium_tests.steps.GTestTest('blink_heap_unittests'), 291 api.chromium_tests.steps.GTestTest('blink_heap_unittests'),
292 api.chromium_tests.steps.GTestTest('blink_platform_unittests'), 292 api.chromium_tests.steps.GTestTest('blink_platform_unittests'),
293 api.chromium_tests.steps.GTestTest('webkit_unit_tests'), 293 api.chromium_tests.steps.GTestTest('webkit_unit_tests'),
294 api.chromium_tests.steps.GTestTest('wtf_unittests'), 294 api.chromium_tests.steps.GTestTest('wtf_unittests'),
295 ]) 295 ])
296 296
297 compile_targets, tests_including_triggered = \ 297 compile_targets, tests_including_triggered = \
298 api.chromium_tests.get_compile_targets_and_tests( 298 api.chromium_tests.get_compile_targets_and_tests(
299 bot_config['mastername'], 299 bot_config['mastername'],
300 bot_config['buildername'], 300 bot_config['buildername'],
301 master_dict, 301 bot_db,
302 test_spec,
303 override_bot_type='builder_tester', 302 override_bot_type='builder_tester',
304 override_tests=tests) 303 override_tests=tests)
305 304
306 test_targets = sorted(set( 305 test_targets = sorted(set(
307 all_compile_targets(api, tests + tests_including_triggered))) 306 all_compile_targets(api, tests + tests_including_triggered)))
308 additional_compile_targets = sorted(set(compile_targets) - 307 additional_compile_targets = sorted(set(compile_targets) -
309 set(test_targets)) 308 set(test_targets))
310 test_targets, compile_targets = \ 309 test_targets, compile_targets = \
311 api.chromium_tests.analyze(affected_files, 310 api.chromium_tests.analyze(affected_files,
312 test_targets, 311 test_targets,
(...skipping 26 matching lines...) Expand all
339 tests.extend(blink_tests) 338 tests.extend(blink_tests)
340 tests_including_triggered.extend(blink_tests) 339 tests_including_triggered.extend(blink_tests)
341 for test in blink_tests: 340 for test in blink_tests:
342 compile_targets.extend(test.compile_targets(api)) 341 compile_targets.extend(test.compile_targets(api))
343 compile_targets = sorted(set(compile_targets)) 342 compile_targets = sorted(set(compile_targets))
344 343
345 api.chromium_tests.compile_specific_targets( 344 api.chromium_tests.compile_specific_targets(
346 bot_config['mastername'], 345 bot_config['mastername'],
347 bot_config['buildername'], 346 bot_config['buildername'],
348 bot_update_step, 347 bot_update_step,
349 master_dict, 348 bot_db,
350 compile_targets, 349 compile_targets,
351 tests_including_triggered, 350 tests_including_triggered,
352 override_bot_type='builder_tester') 351 override_bot_type='builder_tester')
353 else: 352 else:
354 # Even though the patch doesn't require a compile on this platform, 353 # Even though the patch doesn't require a compile on this platform,
355 # we'd still like to run tests not depending on 354 # we'd still like to run tests not depending on
356 # compiled targets (that's obviously not covered by the 355 # compiled targets (that's obviously not covered by the
357 # 'analyze' step) if any source files change. 356 # 'analyze' step) if any source files change.
358 if any([is_source_file(api, f) for f in affected_files]): 357 if any([is_source_file(api, f) for f in affected_files]):
359 tests = [t for t in tests if not t.compile_targets(api)] 358 tests = [t for t in tests if not t.compile_targets(api)]
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 api.test_utils.canned_test_output(passing=True)) 1076 api.test_utils.canned_test_output(passing=True))
1078 ) 1077 )
1079 1078
1080 yield ( 1079 yield (
1081 api.test('use_v8_patch_on_blink_trybot') + 1080 api.test('use_v8_patch_on_blink_trybot') +
1082 props(mastername='tryserver.blink', 1081 props(mastername='tryserver.blink',
1083 buildername='mac_blink_rel', 1082 buildername='mac_blink_rel',
1084 patch_project='v8') + 1083 patch_project='v8') +
1085 api.platform.name('mac') 1084 api.platform.name('mac')
1086 ) 1085 )
OLDNEW
« no previous file with comments | « scripts/slave/recipes/chromium.py ('k') | scripts/slave/recipes/findit/chromium/compile.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698