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 copy | 5 import copy |
| 6 | 6 |
| 7 from slave import recipe_api | 7 from slave import recipe_api |
| 8 | 8 |
| 9 | 9 |
| 10 # Different types of builds this recipe module can do. | 10 # Different types of builds this recipe module can do. |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 # but adding |matching_exes| makes determing if conditional tests are | 460 # but adding |matching_exes| makes determing if conditional tests are |
| 461 # necessary easier. For example, if we didn't do this we could end up | 461 # necessary easier. For example, if we didn't do this we could end up |
| 462 # with chrome_run as a compile_target and not chrome (since chrome_run | 462 # with chrome_run as a compile_target and not chrome (since chrome_run |
| 463 # depends upon chrome). This results in not picking up | 463 # depends upon chrome). This results in not picking up |
| 464 # NaclIntegrationTest as it depends upon chrome not chrome_run. | 464 # NaclIntegrationTest as it depends upon chrome not chrome_run. |
| 465 compile_targets = list(set(self.m.filter.matching_exes + | 465 compile_targets = list(set(self.m.filter.matching_exes + |
| 466 self.m.filter.compile_targets)) | 466 self.m.filter.compile_targets)) |
| 467 | 467 |
| 468 return True, self.m.filter.matching_exes, compile_targets | 468 return True, self.m.filter.matching_exes, compile_targets |
| 469 | 469 |
| 470 def configure_swarming(self, project_name, precommit): | |
| 471 """Configures default swarming dimensions and tags. | |
| 472 | |
| 473 Args: | |
| 474 project_name: Lowercase name of the project, e.g. "blink", "chromium". | |
| 475 precommit: Boolean flag to indicate whether the tests are running before | |
| 476 the changes are commited. | |
| 477 """ | |
| 478 self.m.swarming.set_default_dimension('pool', 'Chrome') | |
| 479 self.m.swarming.add_default_tag('project:%s' % project_name) | |
| 480 self.m.swarming.default_idempotent = True | |
| 481 | |
| 482 if precommit: | |
| 483 self.m.swarming.add_default_tag('purpose:pre-commit') | |
| 484 requester = self.m.properties.get('requester') | |
|
Ken Russell (switch to Gerrit)
2014/10/29 19:16:16
Wow. One of the tests of the "requester" build pro
Sergiy Byelozyorov
2014/10/29 20:04:24
Yeah. I've actually grepped whole repo for "reques
| |
| 485 if requester == 'commit-bot@chromium.org': | |
| 486 self.m.swarming.default_priority = 30 | |
| 487 self.m.swarming.add_default_tag('purpose:CQ') | |
| 488 blamelist = self.m.properties.get('blamelist') | |
| 489 if len(blamelist) == 1: | |
| 490 requester = blamelist[0] | |
| 491 else: | |
| 492 self.m.swarming.default_priority = 50 | |
| 493 self.m.swarming.add_default_tag('purpose:ManualTS') | |
| 494 self.m.swarming.default_user = requester | |
| 495 else: | |
| 496 self.m.swarming.add_default_tag('purpose:post-commit') | |
| 497 self.m.swarming.add_default_tag('purpose:CI') | |
| 498 self.m.swarming.default_priority = 25 | |
| 499 | |
| 470 # Used to build the Google Storage archive url. | 500 # Used to build the Google Storage archive url. |
| 471 # | 501 # |
| 472 # We need to special-case the logic for composing the archive url for a couple | 502 # We need to special-case the logic for composing the archive url for a couple |
| 473 # of masters. That has been moved outside of the compile method. | 503 # of masters. That has been moved outside of the compile method. |
| 474 # | 504 # |
| 475 # Special-cased masters: | 505 # Special-cased masters: |
| 476 # 'chromium.perf': | 506 # 'chromium.perf': |
| 477 # exclude the name of the master from the url. | 507 # exclude the name of the master from the url. |
| 478 # 'tryserver.chromium.perf': | 508 # 'tryserver.chromium.perf': |
| 479 # return nothing so that the archive url specified in factory_properties | 509 # return nothing so that the archive url specified in factory_properties |
| 480 # (as set on the master's configuration) is used instead. | 510 # (as set on the master's configuration) is used instead. |
| 481 def _build_gs_archive_url(self, mastername, master_config): | 511 def _build_gs_archive_url(self, mastername, master_config): |
| 482 if mastername == 'chromium.perf': | 512 if mastername == 'chromium.perf': |
| 483 return self.m.archive.legacy_upload_url( | 513 return self.m.archive.legacy_upload_url( |
| 484 master_config.get('build_gs_bucket'), | 514 master_config.get('build_gs_bucket'), |
| 485 extra_url_components=None) | 515 extra_url_components=None) |
| 486 elif mastername == 'tryserver.chromium.perf': | 516 elif mastername == 'tryserver.chromium.perf': |
| 487 return None | 517 return None |
| 488 else: | 518 else: |
| 489 return self.m.archive.legacy_upload_url( | 519 return self.m.archive.legacy_upload_url( |
| 490 master_config.get('build_gs_bucket'), | 520 master_config.get('build_gs_bucket'), |
| 491 extra_url_components=self.m.properties['mastername']) | 521 extra_url_components=self.m.properties['mastername']) |
| OLD | NEW |