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

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

Issue 688473003: Added swarming step to the Blink trybots (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Addressed comments Created 6 years, 1 month 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 | Annotate | Revision Log
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 DEPS = [ 5 DEPS = [
6 'bot_update', 6 'bot_update',
7 'chromium', 7 'chromium',
8 'chromium_tests',
8 'gclient', 9 'gclient',
10 'isolate',
9 'json', 11 'json',
10 'path', 12 'path',
11 'platform', 13 'platform',
12 'properties', 14 'properties',
13 'python', 15 'python',
14 'raw_io', 16 'raw_io',
15 'rietveld', 17 'rietveld',
16 'step', 18 'step',
19 'swarming',
17 'test_utils', 20 'test_utils',
18 ] 21 ]
19 22
20 23
21 BUILDERS = { 24 BUILDERS = {
22 'tryserver.blink': { 25 'tryserver.blink': {
23 'builders': { 26 'builders': {
24 'linux_blink_dbg': { 27 'linux_blink_dbg': {
25 'chromium_config_kwargs': { 28 'chromium_config_kwargs': {
26 'BUILD_CONFIG': 'Debug', 29 'BUILD_CONFIG': 'Debug',
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 webkit_lint = api.path['build'].join('scripts', 'slave', 'chromium', 267 webkit_lint = api.path['build'].join('scripts', 'slave', 'chromium',
265 'lint_test_files_wrapper.py') 268 'lint_test_files_wrapper.py')
266 webkit_python_tests = api.path['build'].join('scripts', 'slave', 'chromium', 269 webkit_python_tests = api.path['build'].join('scripts', 'slave', 'chromium',
267 'test_webkitpy_wrapper.py') 270 'test_webkitpy_wrapper.py')
268 271
269 # Set patch_root used when applying the patch after checkout. Default None 272 # Set patch_root used when applying the patch after checkout. Default None
270 # makes bot_update determine the patch_root from tryserver root, e.g. 'src'. 273 # makes bot_update determine the patch_root from tryserver root, e.g. 'src'.
271 bot_update_step = api.bot_update.ensure_checkout( 274 bot_update_step = api.bot_update.ensure_checkout(
272 force=True, patch_root=bot_config.get('root_override')) 275 force=True, patch_root=bot_config.get('root_override'))
273 276
277 if bot_config['compile_only']:
278 api.chromium.runhooks()
279 api.chromium.compile()
280 return
281
282 api.chromium_tests.configure_swarming('blink', precommit=True)
283
284 # Swarming uses Isolate to transfer files to swarming bots.
285 # set_isolate_environment modifies GYP_DEFINES to enable test isolation.
286 api.isolate.set_isolate_environment(api.chromium.c)
287
288 # Ensure swarming_client is compatible with what recipes expect.
289 api.swarming.check_client_version()
290
274 api.chromium.runhooks() 291 api.chromium.runhooks()
292
293 api.isolate.clean_isolated_files(api.chromium.output_dir)
275 api.chromium.compile() 294 api.chromium.compile()
295 api.isolate.find_isolated_tests(api.chromium.output_dir)
276 296
277 if not bot_config['compile_only']: 297 api.python('webkit_lint', webkit_lint, [
278 api.python('webkit_lint', webkit_lint, [ 298 '--build-dir', api.path['checkout'].join('out'),
279 '--build-dir', api.path['checkout'].join('out'), 299 '--target', api.chromium.c.BUILD_CONFIG
280 '--target', api.chromium.c.BUILD_CONFIG 300 ])
281 ]) 301 api.python('webkit_python_tests', webkit_python_tests, [
282 api.python('webkit_python_tests', webkit_python_tests, [ 302 '--build-dir', api.path['checkout'].join('out'),
283 '--build-dir', api.path['checkout'].join('out'), 303 '--target', api.chromium.c.BUILD_CONFIG,
284 '--target', api.chromium.c.BUILD_CONFIG, 304 ])
285 ])
286 305
287 # TODO(martiniss) this is pretty goofy 306 # TODO(martiniss) this is pretty goofy
288 failed = False 307 failed = False
289 exception = Exception() # So that pylint doesn't complain 308 exception = Exception() # So that pylint doesn't complain
290 try: 309 try:
291 api.chromium.runtest('webkit_unit_tests', xvfb=True) 310 api.chromium.runtest('webkit_unit_tests', xvfb=True)
292 except api.step.StepFailure as f: 311 except api.step.StepFailure as f:
293 failed = True 312 failed = True
294 exception = f 313 exception = f
295 314
296 try: 315 try:
297 api.chromium.runtest('blink_platform_unittests') 316 api.chromium.runtest('blink_platform_unittests')
298 except api.step.StepFailure as f: 317 except api.step.StepFailure as f:
299 failed = True 318 failed = True
300 exception = f 319 exception = f
301 320
302 try: 321 try:
303 api.chromium.runtest('blink_heap_unittests') 322 api.chromium.runtest('blink_heap_unittests')
304 except api.step.StepFailure as f: 323 except api.step.StepFailure as f:
305 failed = True 324 failed = True
306 exception = f 325 exception = f
307 326
308 try: 327 try:
309 api.chromium.runtest('wtf_unittests') 328 api.chromium.runtest('wtf_unittests')
310 except api.step.StepFailure as f: 329 except api.step.StepFailure as f:
311 failed = True 330 failed = True
312 exception = f 331 exception = f
313 332
314 if failed: 333 if failed:
315 api.python.inline( 334 api.python.inline(
316 'Aborting due to failed build state', 335 'Aborting due to failed build state',
317 "import sys; sys.exit(1)") 336 "import sys; sys.exit(1)")
318 raise exception 337 raise exception
319 338
320 if not bot_config['compile_only']: 339 def deapply_patch_fn(_failing_steps):
321 def deapply_patch_fn(_failing_steps): 340 bot_update_json = bot_update_step.json.output
322 bot_update_json = bot_update_step.json.output 341 api.gclient.c.revisions['src'] = str(
323 api.gclient.c.revisions['src'] = str( 342 bot_update_json['properties']['got_revision'])
324 bot_update_json['properties']['got_revision']) 343 api.gclient.c.revisions['src/third_party/WebKit'] = str(
325 api.gclient.c.revisions['src/third_party/WebKit'] = str( 344 bot_update_json['properties']['got_webkit_revision'])
326 bot_update_json['properties']['got_webkit_revision'])
327 345
328 api.bot_update.ensure_checkout(patch=False, force=True) 346 api.bot_update.ensure_checkout(patch=False, force=True)
329 api.chromium.runhooks() 347 api.chromium.runhooks()
330 api.chromium.compile() 348 api.isolate.clean_isolated_files(api.chromium.output_dir)
349 api.chromium.compile()
350 api.isolate.find_isolated_tests(api.chromium.output_dir)
331 351
332 api.test_utils.determine_new_failures( 352 api.test_utils.determine_new_failures(
333 api, [api.chromium.steps.BlinkTest(api)], deapply_patch_fn) 353 api, [api.chromium.steps.BlinkTest(api)], deapply_patch_fn)
334 354
335 355
336 def _sanitize_nonalpha(text): 356 def _sanitize_nonalpha(text):
337 return ''.join(c if c.isalnum() else '_' for c in text) 357 return ''.join(c if c.isalnum() else '_' for c in text)
338 358
339 359
340 def GenTests(api): 360 def GenTests(api):
341 canned_test = api.json.canned_test_output 361 canned_test = api.json.canned_test_output
342 with_patch = 'webkit_tests (with patch)' 362 with_patch = 'webkit_tests (with patch)'
343 without_patch = 'webkit_tests (without patch)' 363 without_patch = 'webkit_tests (without patch)'
(...skipping 17 matching lines...) Expand all
361 api.test(test_name + ('_pass' if pass_first else '_fail')) + 381 api.test(test_name + ('_pass' if pass_first else '_fail')) +
362 api.step_data(with_patch, canned_test(passing=pass_first)) 382 api.step_data(with_patch, canned_test(passing=pass_first))
363 ) 383 )
364 if not pass_first: 384 if not pass_first:
365 test += api.step_data( 385 test += api.step_data(
366 without_patch, canned_test(passing=False, minimal=True)) 386 without_patch, canned_test(passing=False, minimal=True))
367 tests.append(test) 387 tests.append(test)
368 388
369 for test in tests: 389 for test in tests:
370 test += ( 390 test += (
371 properties(mastername, buildername) + 391 properties(mastername, buildername,
392 blamelist_real=['someone@chromium.org']) +
Ken Russell (switch to Gerrit) 2014/10/29 19:16:16 Is this really necessary for code coverage? It cau
Sergiy Byelozyorov 2014/10/29 20:04:24 It's either that or adding another test with a sin
372 api.platform(bot_config['testing']['platform'], 393 api.platform(bot_config['testing']['platform'],
373 bot_config.get( 394 bot_config.get(
374 'chromium_config_kwargs', {}).get('TARGET_BITS', 64)) 395 'chromium_config_kwargs', {}).get('TARGET_BITS', 64))
375 ) 396 )
376 397
377 yield test 398 yield test
378 399
379 # This tests that if the first fails, but the second pass succeeds 400 # This tests that if the first fails, but the second pass succeeds
380 # that we fail the whole build. 401 # that we fail the whole build.
381 yield ( 402 yield (
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 # and compare the lists of failing tests). 452 # and compare the lists of failing tests).
432 yield ( 453 yield (
433 api.test('too_many_failures_for_retcode') + 454 api.test('too_many_failures_for_retcode') +
434 properties('tryserver.blink', 'linux_blink_rel') + 455 properties('tryserver.blink', 'linux_blink_rel') +
435 api.override_step_data(with_patch, 456 api.override_step_data(with_patch,
436 canned_test(passing=False, 457 canned_test(passing=False,
437 num_additional_failures=125)) + 458 num_additional_failures=125)) +
438 api.override_step_data(without_patch, 459 api.override_step_data(without_patch,
439 canned_test(passing=True, minimal=True)) 460 canned_test(passing=True, minimal=True))
440 ) 461 )
462
463 yield (
464 api.test('non_cq_tryjob') +
465 properties('tryserver.blink', 'win_blink_rel',
466 requester='someone@chromium.org') +
467 api.step_data(with_patch, canned_test(passing=True))
468 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698