| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 'compile_only': False, | 542 'compile_only': False, |
| 543 'testing': { | 543 'testing': { |
| 544 'platform': 'win', | 544 'platform': 'win', |
| 545 }, | 545 }, |
| 546 }, | 546 }, |
| 547 }, | 547 }, |
| 548 }, | 548 }, |
| 549 } | 549 } |
| 550 | 550 |
| 551 | 551 |
| 552 def add_swarming_builder(original, swarming, server): | |
| 553 """Duplicates builder config on |server|, adding 'enable_swarming: True'.""" | |
| 554 assert server in BUILDERS | |
| 555 assert original in BUILDERS[server]['builders'] | |
| 556 assert swarming not in BUILDERS[server]['builders'] | |
| 557 conf = BUILDERS[server]['builders'][original].copy() | |
| 558 conf['enable_swarming'] = True | |
| 559 BUILDERS[server]['builders'][swarming] = conf | |
| 560 | |
| 561 | |
| 562 def get_test_names(tests): | 552 def get_test_names(tests): |
| 563 """Returns the names of each of the tests in |tests|.""" | 553 """Returns the names of each of the tests in |tests|.""" |
| 564 return [test.name for test in tests] | 554 return [test.name for test in tests] |
| 565 | 555 |
| 566 | 556 |
| 567 def filter_tests(possible_tests, needed_tests): | 557 def filter_tests(possible_tests, needed_tests): |
| 568 """Returns a list of all the tests in |possible_tests| whose name is in | 558 """Returns a list of all the tests in |possible_tests| whose name is in |
| 569 |needed_tests|.""" | 559 |needed_tests|.""" |
| 570 result = [] | 560 result = [] |
| 571 for test in possible_tests: | 561 for test in possible_tests: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 589 return sorted(set(x | 579 return sorted(set(x |
| 590 for test in tests | 580 for test in tests |
| 591 for x in test.compile_targets(api))) | 581 for x in test.compile_targets(api))) |
| 592 | 582 |
| 593 | 583 |
| 594 def find_test_named(test_name, tests): | 584 def find_test_named(test_name, tests): |
| 595 """Returns a list with all tests whose name matches |test_name|.""" | 585 """Returns a list with all tests whose name matches |test_name|.""" |
| 596 return [test for test in tests if test.name == test_name] | 586 return [test for test in tests if test.name == test_name] |
| 597 | 587 |
| 598 | 588 |
| 599 add_swarming_builder('linux_chromium_rel', 'linux_chromium_rel_swarming', | |
| 600 'tryserver.chromium.linux') | |
| 601 add_swarming_builder('linux_chromium_chromeos_rel', | |
| 602 'linux_chromium_chromeos_rel_swarming', | |
| 603 'tryserver.chromium.linux') | |
| 604 add_swarming_builder('win_chromium_rel', 'win_chromium_rel_swarming', | |
| 605 'tryserver.chromium.win') | |
| 606 add_swarming_builder('win_chromium_x64_rel', 'win_chromium_x64_rel_swarming', | |
| 607 'tryserver.chromium.win') | |
| 608 add_swarming_builder('mac_chromium_rel', 'mac_chromium_rel_swarming', | |
| 609 'tryserver.chromium.mac') | |
| 610 | |
| 611 | |
| 612 def build_to_priority(build_properties): | 589 def build_to_priority(build_properties): |
| 613 """Returns the Swarming task priority for the build. | 590 """Returns the Swarming task priority for the build. |
| 614 | 591 |
| 615 Does this by determining the build type. Lower is higher priority. | 592 Does this by determining the build type. Lower is higher priority. |
| 616 """ | 593 """ |
| 617 requester = build_properties.get('requester') | 594 requester = build_properties.get('requester') |
| 618 if requester == 'commit-bot@chromium.org': | 595 if requester == 'commit-bot@chromium.org': |
| 619 # Commit queue job. | 596 # Commit queue job. |
| 620 return 30 | 597 return 30 |
| 621 # Normal try job. | 598 # Normal try job. |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 api.json.output([ | 1200 api.json.output([ |
| 1224 { | 1201 { |
| 1225 'error': 'Must not have executable bit set', | 1202 'error': 'Must not have executable bit set', |
| 1226 'rel_path': 'base/basictypes.h', | 1203 'rel_path': 'base/basictypes.h', |
| 1227 }, | 1204 }, |
| 1228 ])) | 1205 ])) |
| 1229 ) | 1206 ) |
| 1230 | 1207 |
| 1231 yield ( | 1208 yield ( |
| 1232 api.test('check_swarming_version_failure') + | 1209 api.test('check_swarming_version_failure') + |
| 1233 props(buildername='linux_chromium_rel_swarming') + | 1210 props(buildername='linux_chromium_rel') + |
| 1234 api.platform.name('linux') + | 1211 api.platform.name('linux') + |
| 1235 api.step_data('swarming.py --version', retcode=1) + | 1212 api.step_data('swarming.py --version', retcode=1) + |
| 1236 api.override_step_data('read test spec', api.json.output({ | 1213 api.override_step_data('read test spec', api.json.output({ |
| 1237 'gtest_tests': [ | 1214 'gtest_tests': [ |
| 1238 { | 1215 { |
| 1239 'test': 'base_unittests', | 1216 'test': 'base_unittests', |
| 1240 'swarming': {'can_use_on_swarming_builders': True}, | 1217 'swarming': {'can_use_on_swarming_builders': True}, |
| 1241 }, | 1218 }, |
| 1242 ], | 1219 ], |
| 1243 }) | 1220 }) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1264 'filename': 'base/basictypes.h', | 1241 'filename': 'base/basictypes.h', |
| 1265 'license': 'UNKNOWN', | 1242 'license': 'UNKNOWN', |
| 1266 }, | 1243 }, |
| 1267 ])) | 1244 ])) |
| 1268 ) | 1245 ) |
| 1269 | 1246 |
| 1270 # Successfully compiling, isolating and running two targets on swarming for a | 1247 # Successfully compiling, isolating and running two targets on swarming for a |
| 1271 # commit queue job. | 1248 # commit queue job. |
| 1272 yield ( | 1249 yield ( |
| 1273 api.test('swarming_basic_cq') + | 1250 api.test('swarming_basic_cq') + |
| 1274 props(buildername='linux_chromium_rel_swarming') + | 1251 props(buildername='linux_chromium_rel') + |
| 1275 api.platform.name('linux') + | 1252 api.platform.name('linux') + |
| 1276 api.override_step_data('read test spec', api.json.output({ | 1253 api.override_step_data('read test spec', api.json.output({ |
| 1277 'gtest_tests': [ | 1254 'gtest_tests': [ |
| 1278 { | 1255 { |
| 1279 'test': 'base_unittests', | 1256 'test': 'base_unittests', |
| 1280 'swarming': {'can_use_on_swarming_builders': True}, | 1257 'swarming': {'can_use_on_swarming_builders': True}, |
| 1281 }, | 1258 }, |
| 1282 { | 1259 { |
| 1283 'test': 'browser_tests', | 1260 'test': 'browser_tests', |
| 1284 'swarming': { | 1261 'swarming': { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1301 api.override_step_data( | 1278 api.override_step_data( |
| 1302 'find isolated tests', | 1279 'find isolated tests', |
| 1303 api.isolate.output_json(['base_unittests', 'browser_tests'])) | 1280 api.isolate.output_json(['base_unittests', 'browser_tests'])) |
| 1304 ) | 1281 ) |
| 1305 | 1282 |
| 1306 # Successfully compiling, isolating and running two targets on swarming for a | 1283 # Successfully compiling, isolating and running two targets on swarming for a |
| 1307 # manual try job. | 1284 # manual try job. |
| 1308 yield ( | 1285 yield ( |
| 1309 api.test('swarming_basic_try_job') + | 1286 api.test('swarming_basic_try_job') + |
| 1310 props( | 1287 props( |
| 1311 buildername='linux_chromium_rel_swarming', | 1288 buildername='linux_chromium_rel', |
| 1312 requester='joe@chromium.org') + | 1289 requester='joe@chromium.org') + |
| 1313 api.platform.name('linux') + | 1290 api.platform.name('linux') + |
| 1314 api.override_step_data('read test spec', api.json.output({ | 1291 api.override_step_data('read test spec', api.json.output({ |
| 1315 'gtest_tests': [ | 1292 'gtest_tests': [ |
| 1316 { | 1293 { |
| 1317 'test': 'base_unittests', | 1294 'test': 'base_unittests', |
| 1318 'swarming': {'can_use_on_swarming_builders': True}, | 1295 'swarming': {'can_use_on_swarming_builders': True}, |
| 1319 }, | 1296 }, |
| 1320 { | 1297 { |
| 1321 'test': 'browser_tests', | 1298 'test': 'browser_tests', |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1337 }, | 1314 }, |
| 1338 })) + | 1315 })) + |
| 1339 api.override_step_data( | 1316 api.override_step_data( |
| 1340 'find isolated tests', | 1317 'find isolated tests', |
| 1341 api.isolate.output_json(['base_unittests', 'browser_tests'])) | 1318 api.isolate.output_json(['base_unittests', 'browser_tests'])) |
| 1342 ) | 1319 ) |
| 1343 | 1320 |
| 1344 # One target (browser_tests) failed to produce *.isolated file. | 1321 # One target (browser_tests) failed to produce *.isolated file. |
| 1345 yield ( | 1322 yield ( |
| 1346 api.test('swarming_missing_isolated') + | 1323 api.test('swarming_missing_isolated') + |
| 1347 props(buildername='linux_chromium_rel_swarming') + | 1324 props(buildername='linux_chromium_rel') + |
| 1348 api.platform.name('linux') + | 1325 api.platform.name('linux') + |
| 1349 api.override_step_data('read test spec', api.json.output({ | 1326 api.override_step_data('read test spec', api.json.output({ |
| 1350 'gtest_tests': [ | 1327 'gtest_tests': [ |
| 1351 { | 1328 { |
| 1352 'test': 'base_unittests', | 1329 'test': 'base_unittests', |
| 1353 'swarming': {'can_use_on_swarming_builders': True}, | 1330 'swarming': {'can_use_on_swarming_builders': True}, |
| 1354 }, | 1331 }, |
| 1355 { | 1332 { |
| 1356 'test': 'browser_tests', | 1333 'test': 'browser_tests', |
| 1357 'swarming': {'can_use_on_swarming_builders': True}, | 1334 'swarming': {'can_use_on_swarming_builders': True}, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1369 })) + | 1346 })) + |
| 1370 api.override_step_data( | 1347 api.override_step_data( |
| 1371 'find isolated tests', | 1348 'find isolated tests', |
| 1372 api.isolate.output_json(['base_unittests'])) | 1349 api.isolate.output_json(['base_unittests'])) |
| 1373 ) | 1350 ) |
| 1374 | 1351 |
| 1375 # One test (base_unittest) failed on swarming. It is retried with | 1352 # One test (base_unittest) failed on swarming. It is retried with |
| 1376 # deapplied patch. | 1353 # deapplied patch. |
| 1377 yield ( | 1354 yield ( |
| 1378 api.test('swarming_deapply_patch') + | 1355 api.test('swarming_deapply_patch') + |
| 1379 props(buildername='linux_chromium_rel_swarming') + | 1356 props(buildername='linux_chromium_rel') + |
| 1380 api.platform.name('linux') + | 1357 api.platform.name('linux') + |
| 1381 api.override_step_data('read test spec', api.json.output({ | 1358 api.override_step_data('read test spec', api.json.output({ |
| 1382 'gtest_tests': [ | 1359 'gtest_tests': [ |
| 1383 { | 1360 { |
| 1384 'test': 'base_unittests', | 1361 'test': 'base_unittests', |
| 1385 'swarming': {'can_use_on_swarming_builders': True}, | 1362 'swarming': {'can_use_on_swarming_builders': True}, |
| 1386 }, | 1363 }, |
| 1387 { | 1364 { |
| 1388 'test': 'browser_tests', | 1365 'test': 'browser_tests', |
| 1389 'swarming': {'can_use_on_swarming_builders': True}, | 1366 'swarming': {'can_use_on_swarming_builders': True}, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 }, | 1536 }, |
| 1560 ], | 1537 ], |
| 1561 }) | 1538 }) |
| 1562 ) + | 1539 ) + |
| 1563 api.override_step_data( | 1540 api.override_step_data( |
| 1564 'analyze', | 1541 'analyze', |
| 1565 api.json.output({'status': 'Found dependency', | 1542 api.json.output({'status': 'Found dependency', |
| 1566 'targets': ['browser_tests', 'base_unittests'], | 1543 'targets': ['browser_tests', 'base_unittests'], |
| 1567 'build_targets': ['base_unittests']})) | 1544 'build_targets': ['base_unittests']})) |
| 1568 ) | 1545 ) |
| OLD | NEW |