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 itertools |
8 import json | 8 import json |
9 | 9 |
10 from recipe_engine.types import freeze | 10 from recipe_engine.types import freeze |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 verbose=True, | 397 verbose=True, |
398 set_swarm_hashes=False) | 398 set_swarm_hashes=False) |
399 | 399 |
400 def archive_build(self, mastername, buildername, update_step, bot_db): | 400 def archive_build(self, mastername, buildername, update_step, bot_db): |
401 bot_config = bot_db.get_bot_config(mastername, buildername) | 401 bot_config = bot_db.get_bot_config(mastername, buildername) |
402 | 402 |
403 if bot_config.get('bot_type') == 'builder': | 403 if bot_config.get('bot_type') == 'builder': |
404 if not bot_config.get('cf_archive_build'): | 404 if not bot_config.get('cf_archive_build'): |
405 master_config = bot_db.get_master_settings(mastername) | 405 master_config = bot_db.get_master_settings(mastername) |
406 build_revision = update_step.presentation.properties['got_revision'] | 406 build_revision = update_step.presentation.properties['got_revision'] |
| 407 |
| 408 # For archiving 'chromium.perf', the builder also archives a version |
| 409 # without perf test files for manual bisect. |
| 410 # (https://bugs.chromium.org/p/chromium/issues/detail?id=604452) |
| 411 if (master_config.get('bisect_builders') and |
| 412 buildername in master_config.get('bisect_builders')): |
| 413 self.m.archive.zip_and_upload_build( |
| 414 'package build for bisect', |
| 415 self.m.chromium.c.build_config_fs, |
| 416 build_url=self._build_bisect_gs_archive_url(master_config), |
| 417 build_revision=build_revision, |
| 418 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
| 419 update_properties=update_step.presentation.properties, |
| 420 exclude_perf_test_files=True, |
| 421 store_by_hash=False |
| 422 ) |
| 423 |
407 self.m.archive.zip_and_upload_build( | 424 self.m.archive.zip_and_upload_build( |
408 'package build', | 425 'package build', |
409 self.m.chromium.c.build_config_fs, | 426 self.m.chromium.c.build_config_fs, |
410 build_url=self._build_gs_archive_url( | 427 build_url=self._build_gs_archive_url( |
411 mastername, master_config, buildername), | 428 mastername, master_config, buildername), |
412 build_revision=build_revision, | 429 build_revision=build_revision, |
413 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | 430 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
414 # TODO(machenbach): Make asan a configuration switch. | 431 # TODO(machenbach): Make asan a configuration switch. |
415 package_dsym_files=( | 432 package_dsym_files=( |
416 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | 433 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 # TODO(phajdan.jr): fix callers and remove get_files_affected_by_patch. | 688 # TODO(phajdan.jr): fix callers and remove get_files_affected_by_patch. |
672 def get_files_affected_by_patch(self, relative_to='src/', cwd=None): | 689 def get_files_affected_by_patch(self, relative_to='src/', cwd=None): |
673 return self.m.chromium_checkout.get_files_affected_by_patch( # pragma: no c
over | 690 return self.m.chromium_checkout.get_files_affected_by_patch( # pragma: no c
over |
674 relative_to, cwd) | 691 relative_to, cwd) |
675 | 692 |
676 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. | 693 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. |
677 def configure_swarming(self, project_name, precommit, mastername=None): | 694 def configure_swarming(self, project_name, precommit, mastername=None): |
678 return self.m.chromium_swarming.configure_swarming( # pragma: no cover | 695 return self.m.chromium_swarming.configure_swarming( # pragma: no cover |
679 project_name, precommit, mastername) | 696 project_name, precommit, mastername) |
680 | 697 |
| 698 def _build_bisect_gs_archive_url(self, master_config): |
| 699 return self.m.archive.legacy_upload_url( |
| 700 master_config.get('bisect_build_gs_bucket'), |
| 701 extra_url_components=master_config.get('bisect_build_gs_extra')) |
| 702 |
681 def _build_gs_archive_url(self, mastername, master_config, buildername): | 703 def _build_gs_archive_url(self, mastername, master_config, buildername): |
682 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. | 704 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |
683 | 705 |
684 Most builders on most masters use a standard format for the build archive | 706 Most builders on most masters use a standard format for the build archive |
685 URL, but some builders on some masters may specify custom places to upload | 707 URL, but some builders on some masters may specify custom places to upload |
686 builds to. These special cases include: | 708 builds to. These special cases include: |
687 'chromium.perf' or 'chromium.perf.fyi': | 709 'chromium.perf' or 'chromium.perf.fyi': |
688 Exclude the name of the master from the url. | 710 Exclude the name of the master from the url. |
689 'tryserver.chromium.perf', or | 711 'tryserver.chromium.perf', or |
690 linux_full_bisect_builder on 'tryserver.chromium.linux': | 712 linux_full_bisect_builder on 'tryserver.chromium.linux': |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 | 803 |
782 if not tests: | 804 if not tests: |
783 return | 805 return |
784 | 806 |
785 api.chromium_swarming.configure_swarming( | 807 api.chromium_swarming.configure_swarming( |
786 'chromium', precommit=False, mastername=mastername) | 808 'chromium', precommit=False, mastername=mastername) |
787 test_runner = api.chromium_tests.create_test_runner( | 809 test_runner = api.chromium_tests.create_test_runner( |
788 api, tests, serialize_tests=bot_config.get('serialize_tests')) | 810 api, tests, serialize_tests=bot_config.get('serialize_tests')) |
789 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): | 811 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): |
790 test_runner() | 812 test_runner() |
OLD | NEW |