Chromium Code Reviews| 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 (mastername.startswith('chromium.perf') and | |
|
ghost stip (do not use)
2016/08/15 20:12:16
I'm not comfortable with having an if statement ga
miimnk
2016/08/15 21:41:22
If you see recipe_modules/chromium_tests/chromium_
| |
| 438 master_config.get('bisect_builders') is not None and | |
| 439 buildername in master_config.get('bisect_builders')): | |
| 440 self.m.archive.zip_and_upload_build( | |
| 441 'package build for bisect', | |
| 442 self.m.chromium.c.build_config_fs, | |
| 443 build_url=self._build_bisect_gs_archive_url(master_config), | |
| 444 build_revision=build_revision, | |
| 445 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | |
| 446 update_properties=update_step.presentation.properties, | |
| 447 include_perf_test_files=False, | |
| 448 store_by_hash=False | |
| 449 ) | |
| 450 | |
| 433 self.m.archive.zip_and_upload_build( | 451 self.m.archive.zip_and_upload_build( |
| 434 'package build', | 452 'package build', |
| 435 self.m.chromium.c.build_config_fs, | 453 self.m.chromium.c.build_config_fs, |
| 436 build_url=self._build_gs_archive_url( | 454 build_url=self._build_gs_archive_url( |
| 437 mastername, master_config, buildername), | 455 mastername, master_config, buildername), |
| 438 build_revision=build_revision, | 456 build_revision=build_revision, |
| 439 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, | 457 cros_board=self.m.chromium.c.TARGET_CROS_BOARD, |
| 440 # TODO(machenbach): Make asan a configuration switch. | 458 # TODO(machenbach): Make asan a configuration switch. |
| 441 package_dsym_files=( | 459 package_dsym_files=( |
| 442 self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan') and | 460 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) | 726 path = str(path) |
| 709 assert path.startswith(relative_to) | 727 assert path.startswith(relative_to) |
| 710 files[i] = path[len(relative_to):] | 728 files[i] = path[len(relative_to):] |
| 711 return files | 729 return files |
| 712 | 730 |
| 713 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. | 731 # TODO(phajdan.jr): fix callers and remove chromium_tests.configure_swarming. |
| 714 def configure_swarming(self, project_name, precommit, mastername=None): | 732 def configure_swarming(self, project_name, precommit, mastername=None): |
| 715 return self.m.chromium_swarming.configure_swarming( # pragma: no cover | 733 return self.m.chromium_swarming.configure_swarming( # pragma: no cover |
| 716 project_name, precommit, mastername) | 734 project_name, precommit, mastername) |
| 717 | 735 |
| 736 def _build_bisect_gs_archive_url(self, master_config): | |
| 737 return self.m.archive.legacy_upload_url( | |
| 738 master_config.get('bisect_build_gs_bucket'), | |
| 739 extra_url_components=master_config.get('bisect_build_gs_extra')) | |
| 740 | |
| 718 def _build_gs_archive_url(self, mastername, master_config, buildername): | 741 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. | 742 """Returns the archive URL to pass to self.m.archive.zip_and_upload_build. |
| 720 | 743 |
| 721 Most builders on most masters use a standard format for the build archive | 744 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 | 745 URL, but some builders on some masters may specify custom places to upload |
| 723 builds to. These special cases include: | 746 builds to. These special cases include: |
| 724 'chromium.perf' or 'chromium.perf.fyi': | 747 'chromium.perf' or 'chromium.perf.fyi': |
| 725 Exclude the name of the master from the url. | 748 Exclude the name of the master from the url. |
| 726 'tryserver.chromium.perf', or | 749 'tryserver.chromium.perf', or |
| 727 linux_full_bisect_builder on 'tryserver.chromium.linux': | 750 linux_full_bisect_builder on 'tryserver.chromium.linux': |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 818 | 841 |
| 819 if not tests: | 842 if not tests: |
| 820 return | 843 return |
| 821 | 844 |
| 822 api.chromium_swarming.configure_swarming( | 845 api.chromium_swarming.configure_swarming( |
| 823 'chromium', precommit=False, mastername=mastername) | 846 'chromium', precommit=False, mastername=mastername) |
| 824 test_runner = api.chromium_tests.create_test_runner( | 847 test_runner = api.chromium_tests.create_test_runner( |
| 825 api, tests, serialize_tests=bot_config.get('serialize_tests')) | 848 api, tests, serialize_tests=bot_config.get('serialize_tests')) |
| 826 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): | 849 with api.chromium_tests.wrap_chromium_tests(bot_config, tests): |
| 827 test_runner() | 850 test_runner() |
| OLD | NEW |