Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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') |
|
M-A Ruel
2014/10/29 14:14:27
precommit=True
Sergiy Byelozyorov
2014/10/29 14:43:45
Done.
| |
| 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. |
| 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( |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 api.properties.generic( |
|
M-A Ruel
2014/10/29 14:14:27
Can you convert it to:
props(buildername='linux_ar
Sergiy Byelozyorov
2014/10/29 14:43:45
Done. Also renamed "requestor" to "requester" here
| |
| 1202 mastername='tryserver.chromium.linux', | 1174 mastername='tryserver.chromium.linux', |
| 1203 buildername='linux_arm', | 1175 buildername='linux_arm', |
| 1204 requestor='commit-bot@chromium.org', | 1176 requestor='commit-bot@chromium.org', |
| 1205 blamelist='joe@chromium.org', | 1177 blamelist='joe@chromium.org', |
| 1206 blamelist_real=['joe@chromium.org']) + | 1178 blamelist_real=['joe@chromium.org']) + |
| 1207 api.platform('linux', 64) + | 1179 api.platform('linux', 64) + |
| 1208 api.override_step_data('read test spec', api.json.output({ | 1180 api.override_step_data('read test spec', api.json.output({ |
| 1209 'compile_targets': ['browser_tests_run'], | 1181 'compile_targets': ['browser_tests_run'], |
| 1210 'gtest_tests': [ | 1182 'gtest_tests': [ |
| 1211 { | 1183 { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1270 'filename': 'base/basictypes.h', | 1242 'filename': 'base/basictypes.h', |
| 1271 'license': 'UNKNOWN', | 1243 'license': 'UNKNOWN', |
| 1272 }, | 1244 }, |
| 1273 ])) | 1245 ])) |
| 1274 ) | 1246 ) |
| 1275 | 1247 |
| 1276 # Successfully compiling, isolating and running two targets on swarming for a | 1248 # Successfully compiling, isolating and running two targets on swarming for a |
| 1277 # commit queue job. | 1249 # commit queue job. |
| 1278 yield ( | 1250 yield ( |
| 1279 api.test('swarming_basic_cq') + | 1251 api.test('swarming_basic_cq') + |
| 1280 props(buildername='linux_chromium_rel') + | 1252 props(buildername='linux_chromium_rel') + |
|
M-A Ruel
2014/10/29 14:14:27
Please use:
props(
requestor='commit-bot@chrom
Sergiy Byelozyorov
2014/10/29 14:43:45
Done.
| |
| 1281 api.platform.name('linux') + | 1253 api.platform.name('linux') + |
| 1282 api.override_step_data('read test spec', api.json.output({ | 1254 api.override_step_data('read test spec', api.json.output({ |
| 1283 'gtest_tests': [ | 1255 'gtest_tests': [ |
| 1284 { | 1256 { |
| 1285 'test': 'base_unittests', | 1257 'test': 'base_unittests', |
| 1286 'swarming': {'can_use_on_swarming_builders': True}, | 1258 'swarming': {'can_use_on_swarming_builders': True}, |
| 1287 }, | 1259 }, |
| 1288 { | 1260 { |
| 1289 'test': 'browser_tests', | 1261 'test': 'browser_tests', |
| 1290 'swarming': { | 1262 'swarming': { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1343 }, | 1315 }, |
| 1344 })) + | 1316 })) + |
| 1345 api.override_step_data( | 1317 api.override_step_data( |
| 1346 'find isolated tests', | 1318 'find isolated tests', |
| 1347 api.isolate.output_json(['base_unittests', 'browser_tests'])) | 1319 api.isolate.output_json(['base_unittests', 'browser_tests'])) |
| 1348 ) | 1320 ) |
| 1349 | 1321 |
| 1350 # One target (browser_tests) failed to produce *.isolated file. | 1322 # One target (browser_tests) failed to produce *.isolated file. |
| 1351 yield ( | 1323 yield ( |
| 1352 api.test('swarming_missing_isolated') + | 1324 api.test('swarming_missing_isolated') + |
| 1353 props(buildername='linux_chromium_rel') + | 1325 props(buildername='linux_chromium_rel') + |
|
M-A Ruel
2014/10/29 14:14:27
Please use:
props(
requestor='commit-bot@chrom
Sergiy Byelozyorov
2014/10/29 14:43:45
Done.
| |
| 1354 api.platform.name('linux') + | 1326 api.platform.name('linux') + |
| 1355 api.override_step_data('read test spec', api.json.output({ | 1327 api.override_step_data('read test spec', api.json.output({ |
| 1356 'gtest_tests': [ | 1328 'gtest_tests': [ |
| 1357 { | 1329 { |
| 1358 'test': 'base_unittests', | 1330 'test': 'base_unittests', |
| 1359 'swarming': {'can_use_on_swarming_builders': True}, | 1331 'swarming': {'can_use_on_swarming_builders': True}, |
| 1360 }, | 1332 }, |
| 1361 { | 1333 { |
| 1362 'test': 'browser_tests', | 1334 'test': 'browser_tests', |
| 1363 'swarming': {'can_use_on_swarming_builders': True}, | 1335 'swarming': {'can_use_on_swarming_builders': True}, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1375 })) + | 1347 })) + |
| 1376 api.override_step_data( | 1348 api.override_step_data( |
| 1377 'find isolated tests', | 1349 'find isolated tests', |
| 1378 api.isolate.output_json(['base_unittests'])) | 1350 api.isolate.output_json(['base_unittests'])) |
| 1379 ) | 1351 ) |
| 1380 | 1352 |
| 1381 # One test (base_unittest) failed on swarming. It is retried with | 1353 # One test (base_unittest) failed on swarming. It is retried with |
| 1382 # deapplied patch. | 1354 # deapplied patch. |
| 1383 yield ( | 1355 yield ( |
| 1384 api.test('swarming_deapply_patch') + | 1356 api.test('swarming_deapply_patch') + |
| 1385 props(buildername='linux_chromium_rel') + | 1357 props(buildername='linux_chromium_rel') + |
|
M-A Ruel
2014/10/29 14:14:27
Please use:
props(
requestor='commit-bot@chrom
Sergiy Byelozyorov
2014/10/29 14:43:45
Done.
| |
| 1386 api.platform.name('linux') + | 1358 api.platform.name('linux') + |
| 1387 api.override_step_data('read test spec', api.json.output({ | 1359 api.override_step_data('read test spec', api.json.output({ |
| 1388 'gtest_tests': [ | 1360 'gtest_tests': [ |
| 1389 { | 1361 { |
| 1390 'test': 'base_unittests', | 1362 'test': 'base_unittests', |
| 1391 'swarming': {'can_use_on_swarming_builders': True}, | 1363 'swarming': {'can_use_on_swarming_builders': True}, |
| 1392 }, | 1364 }, |
| 1393 { | 1365 { |
| 1394 'test': 'browser_tests', | 1366 'test': 'browser_tests', |
| 1395 'swarming': {'can_use_on_swarming_builders': True}, | 1367 'swarming': {'can_use_on_swarming_builders': True}, |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1590 'test': 'base_tests', | 1562 'test': 'base_tests', |
| 1591 'args': ['--gtest-filter: *NaCl*.*'], | 1563 'args': ['--gtest-filter: *NaCl*.*'], |
| 1592 }, | 1564 }, |
| 1593 ], | 1565 ], |
| 1594 }) | 1566 }) |
| 1595 ) + | 1567 ) + |
| 1596 api.override_step_data( | 1568 api.override_step_data( |
| 1597 'analyze', | 1569 'analyze', |
| 1598 api.json.output({'invalid_targets': 'invalid target'})) | 1570 api.json.output({'invalid_targets': 'invalid target'})) |
| 1599 ) | 1571 ) |
| OLD | NEW |