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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 793 | 793 |
| 794 # Tests that are only run if their compile_targets are going to be built. | 794 # Tests that are only run if their compile_targets are going to be built. |
| 795 conditional_tests = [api.chromium.steps.NaclIntegrationTest()] | 795 conditional_tests = [api.chromium.steps.NaclIntegrationTest()] |
| 796 if bot_config.get('add_telemetry_tests', True): | 796 if bot_config.get('add_telemetry_tests', True): |
| 797 conditional_tests += [api.chromium.steps.TelemetryUnitTests(), | 797 conditional_tests += [api.chromium.steps.TelemetryUnitTests(), |
| 798 api.chromium.steps.TelemetryPerfUnitTests()] | 798 api.chromium.steps.TelemetryPerfUnitTests()] |
| 799 | 799 |
| 800 # See if the patch needs to compile on the current platform. | 800 # See if the patch needs to compile on the current platform. |
| 801 # Don't run analyze for other projects, such as blink, as there aren't that | 801 # Don't run analyze for other projects, such as blink, as there aren't that |
| 802 # many try jobs for them. | 802 # many try jobs for them. |
| 803 requires_compile = True | |
| 803 if isinstance(test_spec, dict) and api.properties.get('root') == 'src': | 804 if isinstance(test_spec, dict) and api.properties.get('root') == 'src': |
| 804 analyze_config_file = bot_config['testing'].get('analyze_config_file', | 805 analyze_config_file = bot_config['testing'].get('analyze_config_file', |
| 805 'trybot_analyze_config.json') | 806 'trybot_analyze_config.json') |
| 806 requires_compile, matching_exes, compile_targets = \ | 807 requires_compile, matching_exes, compile_targets = \ |
| 807 api.chromium_tests.analyze( | 808 api.chromium_tests.analyze( |
| 808 get_test_names(gtest_tests) + | 809 get_test_names(gtest_tests) + |
| 809 all_compile_targets(api, conditional_tests), | 810 all_compile_targets(api, conditional_tests), |
| 810 compile_targets, | 811 compile_targets, |
| 811 analyze_config_file) | 812 analyze_config_file) |
| 812 | 813 |
| 813 if not requires_compile: | |
| 814 return [], bot_update_step | |
| 815 | |
| 816 gtest_tests = filter_tests(gtest_tests, matching_exes) | 814 gtest_tests = filter_tests(gtest_tests, matching_exes) |
| 817 | 815 |
| 818 tests = [] | 816 tests = [] |
| 819 # TODO(phajdan.jr): Re-enable checkdeps on Windows when it works with git. | 817 # TODO(phajdan.jr): Re-enable checkdeps on Windows when it works with git. |
| 820 if not api.platform.is_win: | 818 if not api.platform.is_win: |
| 821 tests.append(api.chromium.steps.ScriptTest('checkdeps', 'checkdeps.py')) | 819 tests.append(api.chromium.steps.ScriptTest('checkdeps', 'checkdeps.py')) |
| 822 if api.platform.is_linux: | 820 if api.platform.is_linux: |
| 823 tests.extend([ | 821 tests.extend([ |
| 824 api.chromium.steps.CheckpermsTest(), | 822 api.chromium.steps.CheckpermsTest(), |
| 825 api.chromium.steps.ChecklicensesTest(), | 823 api.chromium.steps.ChecklicensesTest(), |
| 826 ]) | 824 ]) |
| 827 | 825 |
| 828 conditional_tests = tests_in_compile_targets( | 826 conditional_tests = tests_in_compile_targets( |
| 829 api, compile_targets, conditional_tests) | 827 api, compile_targets, conditional_tests) |
| 830 tests.extend(find_test_named(api.chromium.steps.TelemetryUnitTests.name, | 828 tests.extend(find_test_named(api.chromium.steps.TelemetryUnitTests.name, |
| 831 conditional_tests)) | 829 conditional_tests)) |
| 832 tests.extend(find_test_named(api.chromium.steps.TelemetryPerfUnitTests.name, | 830 tests.extend(find_test_named(api.chromium.steps.TelemetryPerfUnitTests.name, |
| 833 conditional_tests)) | 831 conditional_tests)) |
| 834 tests.extend(gtest_tests) | 832 tests.extend(gtest_tests) |
| 835 tests.extend(find_test_named(api.chromium.steps.NaclIntegrationTest.name, | 833 tests.extend(find_test_named(api.chromium.steps.NaclIntegrationTest.name, |
| 836 conditional_tests)) | 834 conditional_tests)) |
| 837 # MojoPythonTests don't require anything to be compiled. | 835 # MojoPythonTests don't require anything to be compiled. |
| 838 tests.append(api.chromium.steps.MojoPythonTests()) | 836 tests.append(api.chromium.steps.MojoPythonTests()) |
| 839 | 837 |
| 840 if api.platform.is_win: | 838 if api.platform.is_win: |
| 841 tests.append(api.chromium.steps.MiniInstallerTest()) | 839 tests.append(api.chromium.steps.MiniInstallerTest()) |
| 842 | 840 |
| 841 if not requires_compile: | |
|
sky
2014/10/16 16:44:18
Document why we do this.
Paweł Hajdan Jr.
2014/10/17 10:42:11
Done.
| |
| 842 tests = [t for t in tests if not t.compile_targets(api)] | |
|
sky
2014/10/16 16:44:18
Should an explicit function be added instead of re
Paweł Hajdan Jr.
2014/10/17 10:42:11
I'd prefer to keep the interface of Test small. We
| |
| 843 return tests, bot_update_step | |
| 844 | |
| 843 has_swarming_tests = any(t.uses_swarming for t in tests) | 845 has_swarming_tests = any(t.uses_swarming for t in tests) |
| 844 | 846 |
| 845 # Swarming uses Isolate to transfer files to swarming bots. | 847 # Swarming uses Isolate to transfer files to swarming bots. |
| 846 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. | 848 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. |
| 847 if bot_config.get('use_isolate') or has_swarming_tests: | 849 if bot_config.get('use_isolate') or has_swarming_tests: |
| 848 api.isolate.set_isolate_environment(api.chromium.c) | 850 api.isolate.set_isolate_environment(api.chromium.c) |
| 849 | 851 |
| 850 # If going to use swarming_client (pinned in src/DEPS), ensure it is | 852 # If going to use swarming_client (pinned in src/DEPS), ensure it is |
| 851 # compatible with what recipes expect. | 853 # compatible with what recipes expect. |
| 852 if has_swarming_tests: | 854 if has_swarming_tests: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 master_dict, | 954 master_dict, |
| 953 override_bot_type='builder_tester', | 955 override_bot_type='builder_tester', |
| 954 override_tests=tests) | 956 override_tests=tests) |
| 955 | 957 |
| 956 requires_compile, matching_exes, compile_targets = \ | 958 requires_compile, matching_exes, compile_targets = \ |
| 957 api.chromium_tests.analyze( | 959 api.chromium_tests.analyze( |
| 958 all_compile_targets(api, tests + tests_including_triggered), | 960 all_compile_targets(api, tests + tests_including_triggered), |
| 959 compile_targets, | 961 compile_targets, |
| 960 'trybot_analyze_config.json') | 962 'trybot_analyze_config.json') |
| 961 | 963 |
| 962 if not requires_compile: | 964 if requires_compile: |
| 963 return | 965 tests = filter_tests(tests, matching_exes) |
| 966 tests_including_triggered = filter_tests( | |
| 967 tests_including_triggered, matching_exes) | |
| 964 | 968 |
| 965 tests = filter_tests(tests, matching_exes) | 969 api.chromium_tests.compile_specific_targets( |
| 966 tests_including_triggered = filter_tests( | 970 main_waterfall_config['mastername'], |
| 967 tests_including_triggered, matching_exes) | 971 main_waterfall_config['buildername'], |
| 972 bot_update_step, | |
| 973 master_dict, | |
| 974 test_spec, | |
| 975 compile_targets, | |
| 976 tests_including_triggered, | |
| 977 override_bot_type='builder_tester') | |
| 978 else: | |
| 979 tests = [t for t in tests if not t.compile_targets(api)] | |
| 968 | 980 |
| 969 api.chromium_tests.compile_specific_targets( | |
| 970 main_waterfall_config['mastername'], | |
| 971 main_waterfall_config['buildername'], | |
| 972 bot_update_step, | |
| 973 master_dict, | |
| 974 test_spec, | |
| 975 compile_targets, | |
| 976 tests_including_triggered, | |
| 977 override_bot_type='builder_tester') | |
| 978 else: | 981 else: |
| 979 # TODO(phajdan.jr): Remove the legacy trybot-specific codepath. | 982 # TODO(phajdan.jr): Remove the legacy trybot-specific codepath. |
| 980 tests, bot_update_step = compile_and_return_tests( | 983 tests, bot_update_step = compile_and_return_tests( |
| 981 mastername, buildername) | 984 mastername, buildername) |
| 982 | 985 |
| 983 def deapply_patch_fn(failing_tests): | 986 def deapply_patch_fn(failing_tests): |
| 984 api.chromium_tests.deapply_patch(bot_update_step) | 987 api.chromium_tests.deapply_patch(bot_update_step) |
| 985 compile_targets = list(api.itertools.chain( | 988 compile_targets = list(api.itertools.chain( |
| 986 *[t.compile_targets(api) for t in failing_tests])) | 989 *[t.compile_targets(api) for t in failing_tests])) |
| 987 if compile_targets: | 990 if compile_targets: |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 }, | 1541 }, |
| 1539 ], | 1542 ], |
| 1540 }) | 1543 }) |
| 1541 ) + | 1544 ) + |
| 1542 api.override_step_data( | 1545 api.override_step_data( |
| 1543 'analyze', | 1546 'analyze', |
| 1544 api.json.output({'status': 'Found dependency', | 1547 api.json.output({'status': 'Found dependency', |
| 1545 'targets': ['browser_tests', 'base_unittests'], | 1548 'targets': ['browser_tests', 'base_unittests'], |
| 1546 'build_targets': ['base_unittests']})) | 1549 'build_targets': ['base_unittests']})) |
| 1547 ) | 1550 ) |
| OLD | NEW |