| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 itertools | 5 from infra.libs.infra_types import freeze |
| 6 | |
| 7 from recipe_engine.types import freeze | |
| 8 | 6 |
| 9 DEPS = [ | 7 DEPS = [ |
| 10 'bot_update', | 8 'bot_update', |
| 11 'chromium', | 9 'chromium', |
| 12 'chromium_android', | 10 'chromium_android', |
| 13 'chromium_tests', | 11 'chromium_tests', |
| 14 'gclient', | 12 'gclient', |
| 15 'gpu', | 13 'gpu', |
| 16 'isolate', | 14 'isolate', |
| 15 'itertools', |
| 17 'json', | 16 'json', |
| 18 'path', | 17 'path', |
| 19 'platform', | 18 'platform', |
| 20 'properties', | 19 'properties', |
| 21 'python', | 20 'python', |
| 22 'raw_io', | 21 'raw_io', |
| 23 'step', | 22 'step', |
| 24 'swarming', | 23 'swarming', |
| 25 'test_utils', | 24 'test_utils', |
| 26 'tryserver', | 25 'tryserver', |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 try: | 388 try: |
| 390 api.chromium.runhooks(name='runhooks (with patch)') | 389 api.chromium.runhooks(name='runhooks (with patch)') |
| 391 except api.step.StepFailure: | 390 except api.step.StepFailure: |
| 392 # As part of deapplying patch we call runhooks without the patch. | 391 # As part of deapplying patch we call runhooks without the patch. |
| 393 api.chromium_tests.deapply_patch(bot_update_step) | 392 api.chromium_tests.deapply_patch(bot_update_step) |
| 394 raise | 393 raise |
| 395 | 394 |
| 396 if bot_config.get('use_isolate'): | 395 if bot_config.get('use_isolate'): |
| 397 api.isolate.clean_isolated_files(api.chromium.output_dir) | 396 api.isolate.clean_isolated_files(api.chromium.output_dir) |
| 398 | 397 |
| 399 compile_targets.extend(itertools.chain( | 398 compile_targets.extend(api.itertools.chain( |
| 400 *[t.compile_targets(api) for t in tests])) | 399 *[t.compile_targets(api) for t in tests])) |
| 401 # Remove duplicate targets. | 400 # Remove duplicate targets. |
| 402 compile_targets = sorted(set(compile_targets)) | 401 compile_targets = sorted(set(compile_targets)) |
| 403 try: | 402 try: |
| 404 api.chromium.compile(compile_targets, name='compile (with patch)') | 403 api.chromium.compile(compile_targets, name='compile (with patch)') |
| 405 except api.step.StepFailure: | 404 except api.step.StepFailure: |
| 406 api.chromium_tests.deapply_patch(bot_update_step) | 405 api.chromium_tests.deapply_patch(bot_update_step) |
| 407 api.chromium.compile( | 406 api.chromium.compile( |
| 408 compile_targets, name='compile (without patch)') | 407 compile_targets, name='compile (without patch)') |
| 409 raise | 408 raise |
| (...skipping 11 matching lines...) Expand all Loading... |
| 421 | 420 |
| 422 mastername = api.properties.get('mastername') | 421 mastername = api.properties.get('mastername') |
| 423 buildername = api.properties.get('buildername') | 422 buildername = api.properties.get('buildername') |
| 424 api.chromium_tests.configure_swarming('chromium', precommit=True) | 423 api.chromium_tests.configure_swarming('chromium', precommit=True) |
| 425 | 424 |
| 426 tests, bot_update_step = compile_and_return_tests( | 425 tests, bot_update_step = compile_and_return_tests( |
| 427 mastername, buildername) | 426 mastername, buildername) |
| 428 | 427 |
| 429 def deapply_patch_fn(failing_tests): | 428 def deapply_patch_fn(failing_tests): |
| 430 api.chromium_tests.deapply_patch(bot_update_step) | 429 api.chromium_tests.deapply_patch(bot_update_step) |
| 431 compile_targets = sorted(list(set(itertools.chain( | 430 compile_targets = sorted(list(set(api.itertools.chain( |
| 432 *[t.compile_targets(api) for t in failing_tests])))) | 431 *[t.compile_targets(api) for t in failing_tests])))) |
| 433 if compile_targets: | 432 if compile_targets: |
| 434 api.chromium.compile( | 433 api.chromium.compile( |
| 435 compile_targets, name='compile (without patch)') | 434 compile_targets, name='compile (without patch)') |
| 436 | 435 |
| 437 return api.test_utils.determine_new_failures(api, tests, deapply_patch_fn) | 436 return api.test_utils.determine_new_failures(api, tests, deapply_patch_fn) |
| 438 | 437 |
| 439 | 438 |
| 440 def RunSteps(api): | 439 def RunSteps(api): |
| 441 with api.tryserver.set_failure_hash(): | 440 with api.tryserver.set_failure_hash(): |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 'test': 'base_tests', | 849 'test': 'base_tests', |
| 851 'args': ['--gtest-filter: *NaCl*.*'], | 850 'args': ['--gtest-filter: *NaCl*.*'], |
| 852 }, | 851 }, |
| 853 ], | 852 ], |
| 854 }) | 853 }) |
| 855 ) + | 854 ) + |
| 856 api.override_step_data( | 855 api.override_step_data( |
| 857 'analyze', | 856 'analyze', |
| 858 api.json.output({'invalid_targets': ['invalid target', 'another one']})) | 857 api.json.output({'invalid_targets': ['invalid target', 'another one']})) |
| 859 ) | 858 ) |
| OLD | NEW |