| 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 import re | 5 import re |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'bot_update', | 8 'bot_update', |
| 9 'chromium', | 9 'chromium', |
| 10 'chromium_tests', | 10 'chromium_tests', |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 # Decide the task priority. | 847 # Decide the task priority. |
| 848 api.swarming.task_priority = build_to_priority(api.properties) | 848 api.swarming.task_priority = build_to_priority(api.properties) |
| 849 | 849 |
| 850 try: | 850 try: |
| 851 api.chromium.runhooks(name='runhooks (with patch)', env=runhooks_env) | 851 api.chromium.runhooks(name='runhooks (with patch)', env=runhooks_env) |
| 852 except api.step.StepFailure: | 852 except api.step.StepFailure: |
| 853 # As part of deapplying patch we call runhooks without the patch. | 853 # As part of deapplying patch we call runhooks without the patch. |
| 854 deapply_patch(bot_update_step) | 854 deapply_patch(bot_update_step) |
| 855 raise | 855 raise |
| 856 | 856 |
| 857 if bot_config.get('use_isolate') or has_swarming_tests: |
| 858 api.isolate.clean_isolated_files(api.chromium.output_dir) |
| 859 |
| 857 compile_targets.extend(api.itertools.chain( | 860 compile_targets.extend(api.itertools.chain( |
| 858 *[t.compile_targets(api) for t in tests])) | 861 *[t.compile_targets(api) for t in tests])) |
| 859 # Remove duplicate targets. | 862 # Remove duplicate targets. |
| 860 compile_targets = sorted(set(compile_targets)) | 863 compile_targets = sorted(set(compile_targets)) |
| 861 try: | 864 try: |
| 862 api.chromium.compile(compile_targets, name='compile (with patch)') | 865 api.chromium.compile(compile_targets, name='compile (with patch)') |
| 863 except api.step.StepFailure: | 866 except api.step.StepFailure: |
| 864 deapply_patch(bot_update_step) | 867 deapply_patch(bot_update_step) |
| 865 try: | 868 try: |
| 866 api.chromium.compile( | 869 api.chromium.compile( |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 tests, bot_update_step = compile_and_return_tests( | 947 tests, bot_update_step = compile_and_return_tests( |
| 945 mastername, buildername) | 948 mastername, buildername) |
| 946 | 949 |
| 947 def deapply_patch_fn(failing_tests): | 950 def deapply_patch_fn(failing_tests): |
| 948 deapply_patch(bot_update_step) | 951 deapply_patch(bot_update_step) |
| 949 compile_targets = list(api.itertools.chain( | 952 compile_targets = list(api.itertools.chain( |
| 950 *[t.compile_targets(api) for t in failing_tests])) | 953 *[t.compile_targets(api) for t in failing_tests])) |
| 951 if compile_targets: | 954 if compile_targets: |
| 952 # Remove duplicate targets. | 955 # Remove duplicate targets. |
| 953 compile_targets = sorted(set(compile_targets)) | 956 compile_targets = sorted(set(compile_targets)) |
| 957 # Search for *.isolated only if enabled in bot config or if some |
| 958 # swarming test is being recompiled. |
| 959 bot_config = get_bot_config(mastername, buildername) |
| 960 has_failing_swarming_tests = [ |
| 961 t for t in failing_tests if t.uses_swarming] |
| 962 if bot_config.get('use_isolate') or has_failing_swarming_tests: |
| 963 api.isolate.clean_isolated_files(api.chromium.output_dir) |
| 954 try: | 964 try: |
| 955 api.chromium.compile( | 965 api.chromium.compile( |
| 956 compile_targets, name='compile (without patch)') | 966 compile_targets, name='compile (without patch)') |
| 957 except api.step.StepFailure: | 967 except api.step.StepFailure: |
| 958 api.tryserver.set_transient_failure_tryjob_result() | 968 api.tryserver.set_transient_failure_tryjob_result() |
| 959 raise | 969 raise |
| 960 # Search for *.isolated only if enabled in bot config or if some | |
| 961 # swarming test is being recompiled. | |
| 962 bot_config = get_bot_config(mastername, buildername) | |
| 963 has_failing_swarming_tests = [ | |
| 964 t for t in failing_tests if t.uses_swarming] | |
| 965 if bot_config.get('use_isolate') or has_failing_swarming_tests: | 970 if bot_config.get('use_isolate') or has_failing_swarming_tests: |
| 966 api.isolate.find_isolated_tests(api.chromium.output_dir) | 971 api.isolate.find_isolated_tests(api.chromium.output_dir) |
| 967 | 972 |
| 968 return api.test_utils.determine_new_failures(api, tests, deapply_patch_fn) | 973 return api.test_utils.determine_new_failures(api, tests, deapply_patch_fn) |
| 969 | 974 |
| 970 | 975 |
| 971 def _sanitize_nonalpha(text): | 976 def _sanitize_nonalpha(text): |
| 972 return ''.join(c if c.isalnum() else '_' for c in text) | 977 return ''.join(c if c.isalnum() else '_' for c in text) |
| 973 | 978 |
| 974 | 979 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 ], | 1450 ], |
| 1446 }) | 1451 }) |
| 1447 ) + | 1452 ) + |
| 1448 api.override_step_data( | 1453 api.override_step_data( |
| 1449 'analyze', | 1454 'analyze', |
| 1450 api.json.output({'status': 'Found dependency', | 1455 api.json.output({'status': 'Found dependency', |
| 1451 'targets': ['browser_tests', 'base_unittests'], | 1456 'targets': ['browser_tests', 'base_unittests'], |
| 1452 'build_targets': ['base_unittests']})) | 1457 'build_targets': ['base_unittests']})) |
| 1453 ) | 1458 ) |
| 1454 | 1459 |
| OLD | NEW |