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

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

Issue 1153933004: Flip GN bots to be purely driven by //testing/buildbot/*.json files for tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: add comment explaining the lack of android tests 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 | Annotate | Revision Log
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 from infra.libs.infra_types import freeze 5 from infra.libs.infra_types import freeze
6 6
7 DEPS = [ 7 DEPS = [
8 'bot_update', 8 'bot_update',
9 'chromium', 9 'chromium',
10 'chromium_tests', 10 'chromium_tests',
(...skipping 28 matching lines...) Expand all
39 }, 39 },
40 'chromium.webkit': { 40 'chromium.webkit': {
41 'builders': { 41 'builders': {
42 'Linux GN': { 42 'Linux GN': {
43 'chromium_config_kwargs': { 43 'chromium_config_kwargs': {
44 'BUILD_CONFIG': 'Release', 44 'BUILD_CONFIG': 'Release',
45 'TARGET_PLATFORM': 'linux', 45 'TARGET_PLATFORM': 'linux',
46 'TARGET_BITS': 64, 46 'TARGET_BITS': 64,
47 }, 47 },
48 'gclient_apply_config': ['blink'], 48 'gclient_apply_config': ['blink'],
49 'should_run_mojo_tests': True,
50 }, 49 },
51 'Linux GN (dbg)': { 50 'Linux GN (dbg)': {
52 'chromium_apply_config': ['gn_component_build'], 51 'chromium_apply_config': ['gn_component_build'],
53 'chromium_config_kwargs': { 52 'chromium_config_kwargs': {
54 'BUILD_CONFIG': 'Debug', 53 'BUILD_CONFIG': 'Debug',
55 'TARGET_PLATFORM': 'linux', 54 'TARGET_PLATFORM': 'linux',
56 'TARGET_BITS': 64, 55 'TARGET_BITS': 64,
57 }, 56 },
58 'gclient_apply_config': ['blink'], 57 'gclient_apply_config': ['blink'],
59 }, 58 },
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 'TARGET_ARCH': 'arm', 105 'TARGET_ARCH': 'arm',
107 }, 106 },
108 'gclient_apply_config': ['android'], 107 'gclient_apply_config': ['android'],
109 }, 108 },
110 'Linux GN': { 109 'Linux GN': {
111 'chromium_config_kwargs': { 110 'chromium_config_kwargs': {
112 'BUILD_CONFIG': 'Release', 111 'BUILD_CONFIG': 'Release',
113 'TARGET_PLATFORM': 'linux', 112 'TARGET_PLATFORM': 'linux',
114 'TARGET_BITS': 64, 113 'TARGET_BITS': 64,
115 }, 114 },
116 'should_run_gn_check': False,
117 'should_run_tests': True,
118 }, 115 },
119 'Linux GN Clobber': { 116 'Linux GN Clobber': {
120 'chromium_config_kwargs': { 117 'chromium_config_kwargs': {
121 'BUILD_CONFIG': 'Release', 118 'BUILD_CONFIG': 'Release',
122 'TARGET_PLATFORM': 'linux', 119 'TARGET_PLATFORM': 'linux',
123 'TARGET_BITS': 64, 120 'TARGET_BITS': 64,
124 }, 121 },
125 'force_clobber': True, 122 'force_clobber': True,
126 }, 123 },
127 'Linux GN (dbg)': { 124 'Linux GN (dbg)': {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 'tryserver.chromium.linux': { 170 'tryserver.chromium.linux': {
174 'builders': { 171 'builders': {
175 'android_chromium_gn_compile_rel': { 172 'android_chromium_gn_compile_rel': {
176 'chromium_apply_config': ['gn_minimal_symbols'], 173 'chromium_apply_config': ['gn_minimal_symbols'],
177 'chromium_config_kwargs': { 174 'chromium_config_kwargs': {
178 'BUILD_CONFIG': 'Release', 175 'BUILD_CONFIG': 'Release',
179 'TARGET_PLATFORM': 'android', 176 'TARGET_PLATFORM': 'android',
180 'TARGET_ARCH': 'arm', 177 'TARGET_ARCH': 'arm',
181 }, 178 },
182 'gclient_apply_config': ['android'], 179 'gclient_apply_config': ['android'],
183 'should_run_gn_check': False,
184 }, 180 },
185 'android_chromium_gn_compile_dbg': { 181 'android_chromium_gn_compile_dbg': {
186 'chromium_apply_config': ['gn_minimal_symbols'], 182 'chromium_apply_config': ['gn_minimal_symbols'],
187 'chromium_config_kwargs': { 183 'chromium_config_kwargs': {
188 'BUILD_CONFIG': 'Debug', 184 'BUILD_CONFIG': 'Debug',
189 'TARGET_PLATFORM': 'android', 185 'TARGET_PLATFORM': 'android',
190 'TARGET_ARCH': 'arm', 186 'TARGET_ARCH': 'arm',
191 }, 187 },
192 'gclient_apply_config': ['android'], 188 'gclient_apply_config': ['android'],
193 }, 189 },
194 'linux_chromium_gn_rel': { 190 'linux_chromium_gn_rel': {
195 'chromium_config_kwargs': { 191 'chromium_config_kwargs': {
196 'BUILD_CONFIG': 'Release', 192 'BUILD_CONFIG': 'Release',
197 'TARGET_PLATFORM': 'linux', 193 'TARGET_PLATFORM': 'linux',
198 'TARGET_BITS': 64, 194 'TARGET_BITS': 64,
199 }, 195 },
200 'should_run_gn_check': False,
201 'should_run_tests': True,
202 }, 196 },
203 'linux_chromium_gn_dbg': { 197 'linux_chromium_gn_dbg': {
204 'chromium_apply_config': ['gn_component_build'], 198 'chromium_apply_config': ['gn_component_build'],
205 'chromium_config_kwargs': { 199 'chromium_config_kwargs': {
206 'BUILD_CONFIG': 'Debug', 200 'BUILD_CONFIG': 'Debug',
207 'TARGET_PLATFORM': 'linux', 201 'TARGET_PLATFORM': 'linux',
208 'TARGET_BITS': 64, 202 'TARGET_BITS': 64,
209 }, 203 },
210 }, 204 },
211 'linux_chromium_gn_chromeos_rel': { 205 'linux_chromium_gn_chromeos_rel': {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 build_output_dir='//out/%s' % api.chromium.c.build_config_fs) 486 build_output_dir='//out/%s' % api.chromium.c.build_config_fs)
493 if requires_compile: 487 if requires_compile:
494 api.chromium.compile(compile_targets, 488 api.chromium.compile(compile_targets,
495 force_clobber=force_clobber) 489 force_clobber=force_clobber)
496 tests = tests_in_compile_targets(api, compile_targets, tests) 490 tests = tests_in_compile_targets(api, compile_targets, tests)
497 else: 491 else:
498 api.chromium.compile(all_compile_targets(api, tests) + 492 api.chromium.compile(all_compile_targets(api, tests) +
499 additional_compile_targets, 493 additional_compile_targets,
500 force_clobber=force_clobber) 494 force_clobber=force_clobber)
501 495
502 # TODO(dpranke): Ensure that every bot runs w/ --check, then make 496 if tests:
503 # it be on by default.
504 if bot_config.get('should_run_gn_check', True):
505 api.chromium.run_gn_check()
506
507 if tests and bot_config.get('should_run_tests', False):
508 if api.tryserver.is_tryserver: 497 if api.tryserver.is_tryserver:
509 api.chromium_tests.run_tests_and_deapply_as_needed( 498 api.chromium_tests.run_tests_and_deapply_as_needed(
510 mastername, api, tests, bot_update_step) 499 mastername, api, tests, bot_update_step)
511 else: 500 else:
512 api.chromium_tests.configure_swarming('chromium', precommit=False, 501 api.chromium_tests.configure_swarming('chromium', precommit=False,
513 mastername=mastername) 502 mastername=mastername)
514 test_runner = api.chromium_tests.create_test_runner(api, tests) 503 test_runner = api.chromium_tests.create_test_runner(api, tests)
515 with api.chromium_tests.wrap_chromium_tests(mastername): 504 with api.chromium_tests.wrap_chromium_tests(mastername):
516 test_runner() 505 test_runner()
517 506
518 507
519 def GenSteps(api): 508 def GenSteps(api):
520 with api.tryserver.set_failure_hash(): 509 with api.tryserver.set_failure_hash():
521 return _GenStepsInternal(api) 510 return _GenStepsInternal(api)
522 511
523 512
524 def GenTests(api): 513 def GenTests(api):
525 overrides = {} 514 overrides = {}
526 for mastername, master_dict in BUILDERS.items(): 515 for mastername, master_dict in BUILDERS.items():
527 for buildername in master_dict['builders']: 516 for buildername in master_dict['builders']:
517
518 # The Android bots are currently all only builders and cannot
519 # run tests; more importantly, the recipe isn't set up to run
520 # tests on Android correctly, and if we specify any tests in
521 # the step_data, the recipe will crash :). We will eventually
522 # fix this by killing this recipe altogether and moving to the
523 # main chromium recipes.
524 is_android = ('Android' in buildername or 'android' in buildername)
525 gtest_tests = [] if is_android else ['base_unittests']
526
528 overrides.setdefault(mastername, {}) 527 overrides.setdefault(mastername, {})
529 overrides[mastername][buildername] = ( 528 overrides[mastername][buildername] = (
530 api.override_step_data( 529 api.override_step_data(
531 'read test spec', 530 'read test spec',
532 api.json.output({ 531 api.json.output({
533 buildername: { 532 buildername: {
534 'gtest_tests': ['base_unittests'], 533 'gtest_tests': gtest_tests,
535 }, 534 },
536 }))) 535 })))
537 536
538 if 'tryserver' in mastername: 537 if 'tryserver' in mastername:
539 overrides[mastername][buildername] += api.override_step_data( 538 overrides[mastername][buildername] += api.override_step_data(
540 'analyze', 539 'analyze',
541 api.json.output({ 540 api.json.output({
542 'status': 'Found dependency', 541 'status': 'Found dependency',
543 'targets': ['base_unittests'], 542 'targets': gtest_tests,
544 'build_targets': ['base_unittests'], 543 'build_targets': gtest_tests,
545 })) 544 }))
546 545
547 for test in api.chromium.gen_tests_for_builders(BUILDERS, overrides): 546 for test in api.chromium.gen_tests_for_builders(BUILDERS, overrides):
548 yield test 547 yield test
549 548
550 yield ( 549 yield (
551 api.test('compile_failure') + 550 api.test('compile_failure') +
552 api.platform.name('linux') + 551 api.platform.name('linux') +
553 api.properties.tryserver( 552 api.properties.tryserver(
554 buildername='linux_chromium_gn_rel', 553 buildername='linux_chromium_gn_rel',
(...skipping 25 matching lines...) Expand all
580 'gtest_tests': ['base_unittests'], 579 'gtest_tests': ['base_unittests'],
581 }})) + 580 }})) +
582 api.override_step_data( 581 api.override_step_data(
583 'analyze', 582 'analyze',
584 api.json.output({ 583 api.json.output({
585 'status': 'Found dependency', 584 'status': 'Found dependency',
586 'targets': ['net_unittests'], 585 'targets': ['net_unittests'],
587 'build_targets': ['net_unittests'], 586 'build_targets': ['net_unittests'],
588 })) 587 }))
589 ) 588 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698