| 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') |
| 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 653 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 |