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

Side by Side Diff: scripts/slave/recipes/chromium_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 'chromium_tests',
9 'gclient', 9 'gclient',
10 'isolate', 10 'isolate',
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 return sorted(set(x 599 return sorted(set(x
600 for test in tests 600 for test in tests
601 for x in test.compile_targets(api))) 601 for x in test.compile_targets(api)))
602 602
603 603
604 def find_test_named(test_name, tests): 604 def find_test_named(test_name, tests):
605 """Returns a list with all tests whose name matches |test_name|.""" 605 """Returns a list with all tests whose name matches |test_name|."""
606 return [test for test in tests if test.name == test_name] 606 return [test for test in tests if test.name == test_name]
607 607
608 608
609 def build_to_priority(build_properties):
610 """Returns the Swarming task priority for the build.
611
612 Does this by determining the build type. Lower is higher priority.
613 """
614 requester = build_properties.get('requester')
615 if requester == 'commit-bot@chromium.org':
616 # Commit queue job.
617 return 30
618 # Normal try job.
619 return 50
620
621
622 def GenSteps(api): 609 def GenSteps(api):
623 def swarming_shards_from_test_spec(test_spec, test_name): 610 def swarming_shards_from_test_spec(test_spec, test_name):
624 if isinstance(test_spec, dict): 611 if isinstance(test_spec, dict):
625 gtest_tests_spec = test_spec.get('gtest_tests', []) 612 gtest_tests_spec = test_spec.get('gtest_tests', [])
626 else: 613 else:
627 # TODO(phajdan.jr): Convert test step data and remove this. 614 # TODO(phajdan.jr): Convert test step data and remove this.
628 gtest_tests_spec = test_spec 615 gtest_tests_spec = test_spec
629 616
630 for test in gtest_tests_spec: 617 for test in gtest_tests_spec:
631 if not isinstance(test, dict): 618 if not isinstance(test, dict):
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 api.isolate.find_isolated_tests(api.chromium.output_dir) 888 api.isolate.find_isolated_tests(api.chromium.output_dir)
902 889
903 if bot_config['compile_only']: 890 if bot_config['compile_only']:
904 tests = [] 891 tests = []
905 892
906 return tests, bot_update_step 893 return tests, bot_update_step
907 894
908 mastername = api.properties.get('mastername') 895 mastername = api.properties.get('mastername')
909 buildername = api.properties.get('buildername') 896 buildername = api.properties.get('buildername')
910 bot_config = get_bot_config(mastername, buildername) 897 bot_config = get_bot_config(mastername, buildername)
911 api.swarming.set_default_dimension('pool', 'Chrome') 898 api.chromium_tests.configure_swarming('chromium', precommit=True)
912 api.swarming.default_priority = build_to_priority(api.properties)
913 api.swarming.add_default_tag('project:chromium')
914 api.swarming.add_default_tag('purpose:pre-commit')
915 api.swarming.default_idempotent = True
916
917 # Differentiate between try jobs and CQ jobs. Always find out who made the CL.
918 requestor = api.properties.get('requestor')
919 if requestor == 'commit-bot@chromium.org':
920 api.swarming.add_default_tag('purpose:CQ')
921 blamelist = api.properties.get('blamelist')
922 if len(blamelist) == 1:
923 requestor = blamelist[0]
924 else:
925 api.swarming.add_default_tag('purpose:ManualTS')
926 api.swarming.default_user = requestor
927 899
928 # TODO(phajdan): uncomment once we have XP or 10.6 trybots. 900 # TODO(phajdan): uncomment once we have XP or 10.6 trybots.
M-A Ruel 2014/10/29 18:11:01 Remove 900-903 while at it. It's stale.
Sergiy Byelozyorov 2014/10/29 20:04:24 Done.
929 #os_dimension = bot_config.get('swarming_dimensions', {}).get('os') 901 #os_dimension = bot_config.get('swarming_dimensions', {}).get('os')
930 #if os_dimension: 902 #if os_dimension:
931 # api.swarming.set_default_dimension('os', os_dimension) 903 # api.swarming.set_default_dimension('os', os_dimension)
932 904
933 main_waterfall_config = bot_config.get('based_on_main_waterfall') 905 main_waterfall_config = bot_config.get('based_on_main_waterfall')
934 if main_waterfall_config: 906 if main_waterfall_config:
935 bot_update_step, master_dict, test_spec = \ 907 bot_update_step, master_dict, test_spec = \
936 api.chromium_tests.sync_and_configure_build( 908 api.chromium_tests.sync_and_configure_build(
937 main_waterfall_config['mastername'], 909 main_waterfall_config['mastername'],
938 main_waterfall_config['buildername'], 910 main_waterfall_config['buildername'],
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 'chromium': { 1163 'chromium': {
1192 'exclusions': [], 1164 'exclusions': [],
1193 }, 1165 },
1194 })) + 1166 })) +
1195 api.step_data('compile (with patch)', retcode=1) + 1167 api.step_data('compile (with patch)', retcode=1) +
1196 api.step_data('compile (without patch)', retcode=1) 1168 api.step_data('compile (without patch)', retcode=1)
1197 ) 1169 )
1198 1170
1199 yield ( 1171 yield (
1200 api.test('arm') + 1172 api.test('arm') +
1201 api.properties.generic( 1173 props(buildername='linux_arm', requester='commit-bot@chromium.org',
1202 mastername='tryserver.chromium.linux', 1174 blamelist='joe@chromium.org', blamelist_real=['joe@chromium.org']) +
1203 buildername='linux_arm',
1204 requestor='commit-bot@chromium.org',
1205 blamelist='joe@chromium.org',
1206 blamelist_real=['joe@chromium.org']) +
1207 api.platform('linux', 64) + 1175 api.platform('linux', 64) +
1208 api.override_step_data('read test spec', api.json.output({ 1176 api.override_step_data('read test spec', api.json.output({
1209 'compile_targets': ['browser_tests_run'], 1177 'compile_targets': ['browser_tests_run'],
1210 'gtest_tests': [ 1178 'gtest_tests': [
1211 { 1179 {
1212 'test': 'browser_tests', 1180 'test': 'browser_tests',
1213 'args': '--gtest-filter: *NaCl*.*', 1181 'args': '--gtest-filter: *NaCl*.*',
1214 }, { 1182 }, {
1215 'test': 'base_tests', 1183 'test': 'base_tests',
1216 'args': ['--gtest-filter: *NaCl*.*'], 1184 'args': ['--gtest-filter: *NaCl*.*'],
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 'filename': 'base/basictypes.h', 1238 'filename': 'base/basictypes.h',
1271 'license': 'UNKNOWN', 1239 'license': 'UNKNOWN',
1272 }, 1240 },
1273 ])) 1241 ]))
1274 ) 1242 )
1275 1243
1276 # Successfully compiling, isolating and running two targets on swarming for a 1244 # Successfully compiling, isolating and running two targets on swarming for a
1277 # commit queue job. 1245 # commit queue job.
1278 yield ( 1246 yield (
1279 api.test('swarming_basic_cq') + 1247 api.test('swarming_basic_cq') +
1280 props(buildername='linux_chromium_rel') + 1248 props(requester='commit-bot@chromium.org', blamelist='joe@chromium.org',
1249 blamelist_real=['joe@chromium.org']) +
1281 api.platform.name('linux') + 1250 api.platform.name('linux') +
1282 api.override_step_data('read test spec', api.json.output({ 1251 api.override_step_data('read test spec', api.json.output({
1283 'gtest_tests': [ 1252 'gtest_tests': [
1284 { 1253 {
1285 'test': 'base_unittests', 1254 'test': 'base_unittests',
1286 'swarming': {'can_use_on_swarming_builders': True}, 1255 'swarming': {'can_use_on_swarming_builders': True},
1287 }, 1256 },
1288 { 1257 {
1289 'test': 'browser_tests', 1258 'test': 'browser_tests',
1290 'swarming': { 1259 'swarming': {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 }, 1312 },
1344 })) + 1313 })) +
1345 api.override_step_data( 1314 api.override_step_data(
1346 'find isolated tests', 1315 'find isolated tests',
1347 api.isolate.output_json(['base_unittests', 'browser_tests'])) 1316 api.isolate.output_json(['base_unittests', 'browser_tests']))
1348 ) 1317 )
1349 1318
1350 # One target (browser_tests) failed to produce *.isolated file. 1319 # One target (browser_tests) failed to produce *.isolated file.
1351 yield ( 1320 yield (
1352 api.test('swarming_missing_isolated') + 1321 api.test('swarming_missing_isolated') +
1353 props(buildername='linux_chromium_rel') + 1322 props(requester='commit-bot@chromium.org', blamelist='joe@chromium.org',
1323 blamelist_real=['joe@chromium.org']) +
1354 api.platform.name('linux') + 1324 api.platform.name('linux') +
1355 api.override_step_data('read test spec', api.json.output({ 1325 api.override_step_data('read test spec', api.json.output({
1356 'gtest_tests': [ 1326 'gtest_tests': [
1357 { 1327 {
1358 'test': 'base_unittests', 1328 'test': 'base_unittests',
1359 'swarming': {'can_use_on_swarming_builders': True}, 1329 'swarming': {'can_use_on_swarming_builders': True},
1360 }, 1330 },
1361 { 1331 {
1362 'test': 'browser_tests', 1332 'test': 'browser_tests',
1363 'swarming': {'can_use_on_swarming_builders': True}, 1333 'swarming': {'can_use_on_swarming_builders': True},
(...skipping 11 matching lines...) Expand all
1375 })) + 1345 })) +
1376 api.override_step_data( 1346 api.override_step_data(
1377 'find isolated tests', 1347 'find isolated tests',
1378 api.isolate.output_json(['base_unittests'])) 1348 api.isolate.output_json(['base_unittests']))
1379 ) 1349 )
1380 1350
1381 # One test (base_unittest) failed on swarming. It is retried with 1351 # One test (base_unittest) failed on swarming. It is retried with
1382 # deapplied patch. 1352 # deapplied patch.
1383 yield ( 1353 yield (
1384 api.test('swarming_deapply_patch') + 1354 api.test('swarming_deapply_patch') +
1385 props(buildername='linux_chromium_rel') + 1355 props(requester='commit-bot@chromium.org', blamelist='joe@chromium.org',
1356 blamelist_real=['joe@chromium.org']) +
1386 api.platform.name('linux') + 1357 api.platform.name('linux') +
1387 api.override_step_data('read test spec', api.json.output({ 1358 api.override_step_data('read test spec', api.json.output({
1388 'gtest_tests': [ 1359 'gtest_tests': [
1389 { 1360 {
1390 'test': 'base_unittests', 1361 'test': 'base_unittests',
1391 'swarming': {'can_use_on_swarming_builders': True}, 1362 'swarming': {'can_use_on_swarming_builders': True},
1392 }, 1363 },
1393 { 1364 {
1394 'test': 'browser_tests', 1365 'test': 'browser_tests',
1395 'swarming': {'can_use_on_swarming_builders': True}, 1366 'swarming': {'can_use_on_swarming_builders': True},
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 'test': 'base_tests', 1561 'test': 'base_tests',
1591 'args': ['--gtest-filter: *NaCl*.*'], 1562 'args': ['--gtest-filter: *NaCl*.*'],
1592 }, 1563 },
1593 ], 1564 ],
1594 }) 1565 })
1595 ) + 1566 ) +
1596 api.override_step_data( 1567 api.override_step_data(
1597 'analyze', 1568 'analyze',
1598 api.json.output({'invalid_targets': 'invalid target'})) 1569 api.json.output({'invalid_targets': 'invalid target'}))
1599 ) 1570 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698