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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 verbose=True, | 423 verbose=True, |
424 set_swarm_hashes=False) | 424 set_swarm_hashes=False) |
425 | 425 |
426 def archive_build(self, mastername, buildername, update_step, bot_db): | 426 def archive_build(self, mastername, buildername, update_step, bot_db): |
427 bot_config = bot_db.get_bot_config(mastername, buildername) | 427 bot_config = bot_db.get_bot_config(mastername, buildername) |
428 | 428 |
429 if bot_config.get('bot_type') == 'builder': | 429 if bot_config.get('bot_type') == 'builder': |
430 if not bot_config.get('cf_archive_build'): | 430 if not bot_config.get('cf_archive_build'): |
431 master_config = bot_db.get_master_settings(mastername) | 431 master_config = bot_db.get_master_settings(mastername) |
432 build_revision = update_step.presentation.properties['got_revision'] | 432 build_revision = update_step.presentation.properties['got_revision'] |
| 433 |
| 434 # For archiving 'chromium.perf', the builder also archives a version |
| 435 # without perf test files for manual bisect. |
| 436 # (https://bugs.chromium.org/p/chromium/issues/detail?id=604452) |
| 437 if (master_config.get('bisect_builders') and |
| 438 buildername in master_config.get('bisect_builders')): |
| 439 self.m.archive.zip_and_upload_build( |
| 440 'package build for bisect', |
| 441 self.m.chromium.c.build_config_fs, |
| 442 build_url=self._build_bisect_gs_archive_url(master_config), |
| 443 build_revision=build_revision, |
| 444 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
| 445 update_properties=update_step.presentation.properties, |
| 446 exclude_perf_test_files=True, |
| 447 store_by_hash=False |
| 448 ) |
| 449 |
433 self.m.archive.zip_and_upload_build( | 450 self.m.archive.zip_and_upload_build( |
434 'package build', | 451 'package build', |
435 self.m.chromium.c.build_config_fs, | 452 self.m.chromium.c.build_config_fs, |
436 build_url=self._build_gs_archive_url( | 453 build_url=self._build_gs_archive_url( |
437 mastername, master_config, buildername), | 454 mastername, master_config, buildername), |
438 build_revision=build_revision, | 455 build_revision=build_revision, |
439 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | 456 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
440 # TODO(machenbach): Make asan a configuration switch. | 457 # TODO(machenbach): Make asan a configuration switch. |
441 package_dsym_files=( | 458 package_dsym_files=( |
442 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | 459 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 path = str(path) | 725 path = str(path) |
709 assert path.startswith(relative_to) | 726 assert path.startswith(relative_to) |
710 files[i] = path[len(relative_to):] | 727 files[i] = path[len(relative_to):] |
711 return files | 728 return files |
712 | 729 |
713 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. | 730 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. |
714 def configure_swarming(self, project_name, precommit, mastername=None): | 731 def configure_swarming(self, project_name, precommit, mastername=None): |
715 return self.m.chromium_swarming.configure_swarming( # pragma: no cover | 732 return self.m.chromium_swarming.configure_swarming( # pragma: no cover |
716 project_name, precommit, mastername) | 733 project_name, precommit, mastername) |
717 | 734 |
| 735 def _build_bisect_gs_archive_url(self, master_config): |
| 736 return self.m.archive.legacy_upload_url( |
| 737 master_config.get('bisect_build_gs_bucket'), |
| 738 extra_url_components=master_config.get('bisect_build_gs_extra')) |
| 739 |
718 def _build_gs_archive_url(self, mastername, master_config, buildername): | 740 def _build_gs_archive_url(self, mastername, master_config, buildername): |
719 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. | 741 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |
720 | 742 |
721 Most builders on most masters use a standard format for the build archive | 743 Most builders on most masters use a standard format for the build archive |
722 URL, but some builders on some masters may specify custom places to upload | 744 URL, but some builders on some masters may specify custom places to upload |
723 builds to. These special cases include: | 745 builds to. These special cases include: |
724 'chromium.perf' or 'chromium.perf.fyi': | 746 'chromium.perf' or 'chromium.perf.fyi': |
725 Exclude the name of the master from the url. | 747 Exclude the name of the master from the url. |
726 'tryserver.chromium.perf', or | 748 'tryserver.chromium.perf', or |
727 linux_full_bisect_builder on 'tryserver.chromium.linux': | 749 linux_full_bisect_builder on 'tryserver.chromium.linux': |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 | 840 |
819 if not tests: | 841 if not tests: |
820 return | 842 return |
821 | 843 |
822 api.chromium_swarming.configure_swarming( | 844 api.chromium_swarming.configure_swarming( |
823 'chromium', precommit=False, mastername=mastername) | 845 'chromium', precommit=False, mastername=mastername) |
824 test_runner = api.chromium_tests.create_test_runner( | 846 test_runner = api.chromium_tests.create_test_runner( |
825 api, tests, serialize_tests=bot_config.get('serialize_tests')) | 847 api, tests, serialize_tests=bot_config.get('serialize_tests')) |
826 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): | 848 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): |
827 test_runner() | 849 test_runner() |
OLD | NEW |