OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 contextlib | 5 import contextlib |
6 import copy | 6 import copy |
| 7 import itertools |
7 import json | 8 import json |
8 | 9 |
9 from infra.libs.infra_types import freeze, thaw | 10 from infra.libs.infra_types import freeze, thaw |
10 from recipe_engine import recipe_api | 11 from recipe_engine import recipe_api |
11 from recipe_engine import util as recipe_util | 12 from recipe_engine import util as recipe_util |
12 | 13 |
13 from . import builders | 14 from . import builders |
14 from . import steps | 15 from . import steps |
15 | 16 |
16 | 17 |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 try: | 494 try: |
494 self.m.chromium.runhooks(name='runhooks (without patch)') | 495 self.m.chromium.runhooks(name='runhooks (without patch)') |
495 except self.m.step.StepFailure: | 496 except self.m.step.StepFailure: |
496 self.m.tryserver.set_transient_failure_tryjob_result() | 497 self.m.tryserver.set_transient_failure_tryjob_result() |
497 raise | 498 raise |
498 | 499 |
499 def run_tests_and_deapply_as_needed(self, mastername, api, tests, | 500 def run_tests_and_deapply_as_needed(self, mastername, api, tests, |
500 bot_update_step): | 501 bot_update_step): |
501 def deapply_patch_fn(failing_tests): | 502 def deapply_patch_fn(failing_tests): |
502 self.deapply_patch(bot_update_step) | 503 self.deapply_patch(bot_update_step) |
503 compile_targets = list(self.m.itertools.chain( | 504 compile_targets = list(itertools.chain( |
504 *[t.compile_targets(api) for t in failing_tests])) | 505 *[t.compile_targets(api) for t in failing_tests])) |
505 if compile_targets: | 506 if compile_targets: |
506 # Remove duplicate targets. | 507 # Remove duplicate targets. |
507 compile_targets = sorted(set(compile_targets)) | 508 compile_targets = sorted(set(compile_targets)) |
508 has_failing_swarming_tests = [ | 509 has_failing_swarming_tests = [ |
509 t for t in failing_tests if t.uses_swarming] | 510 t for t in failing_tests if t.uses_swarming] |
510 if has_failing_swarming_tests: | 511 if has_failing_swarming_tests: |
511 self.m.isolate.clean_isolated_files(self.m.chromium.output_dir) | 512 self.m.isolate.clean_isolated_files(self.m.chromium.output_dir) |
512 try: | 513 try: |
513 self.m.chromium.compile( | 514 self.m.chromium.compile( |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 def get_compile_targets_for_scripts(self): | 702 def get_compile_targets_for_scripts(self): |
702 return self.m.python( | 703 return self.m.python( |
703 name='get compile targets for scripts', | 704 name='get compile targets for scripts', |
704 script=self.m.path['checkout'].join( | 705 script=self.m.path['checkout'].join( |
705 'testing', 'scripts', 'get_compile_targets.py'), | 706 'testing', 'scripts', 'get_compile_targets.py'), |
706 args=[ | 707 args=[ |
707 '--output', self.m.json.output(), | 708 '--output', self.m.json.output(), |
708 '--', | 709 '--', |
709 ] + self.get_common_args_for_scripts(), | 710 ] + self.get_common_args_for_scripts(), |
710 step_test_data=lambda: self.m.json.test_api.output({})) | 711 step_test_data=lambda: self.m.json.test_api.output({})) |
OLD | NEW |