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