예제 #1
0
  def __init__(self, source_repo, manifest_repo, build_name, build_type,
               incr_type, force, branch, manifest=constants.DEFAULT_MANIFEST,
               dry_run=True, master=False):
    """Initialize an LKGM Manager.

    Args:
      build_type:  Type of build.  Must be a pfq type.
    Other args see manifest_version.BuildSpecsManager.
    """
    super(LKGMManager, self).__init__(
        source_repo=source_repo, manifest_repo=manifest_repo,
        manifest=manifest, build_name=build_name, incr_type=incr_type,
        force=force, branch=branch, dry_run=dry_run, master=master)

    self.lkgm_path = os.path.join(self.manifest_dir, self.LKGM_PATH)
    self.compare_versions_fn = _LKGMCandidateInfo.VersionCompare
    self.build_type = build_type
    # Chrome PFQ and PFQ's exist at the same time and version separately so they
    # must have separate subdirs in the manifest-versions repository.
    if self.build_type == constants.CHROME_PFQ_TYPE:
      self.rel_working_dir = self.CHROME_PFQ_SUBDIR
    elif cbuildbot_config.IsCQType(self.build_type):
      self.rel_working_dir = self.COMMIT_QUEUE_SUBDIR
    else:
      assert cbuildbot_config.IsPFQType(self.build_type)
      self.rel_working_dir = self.LKGM_SUBDIR
 def testValidUnifiedMasterConfig(self):
     """Make sure any unified master configurations are valid."""
     for build_name, config in cbuildbot_config.config.iteritems():
         error = 'Unified config for %s has invalid values' % build_name
         # Unified masters must be internal and must rev both overlays.
         if config['master']:
             self.assertTrue(
                 config['internal'] and config['manifest_version'], error)
         elif not config['master'] and config['manifest_version']:
             # Unified slaves can rev either public or both depending on whether
             # they are internal or not.
             if not config['internal']:
                 self.assertEqual(config['overlays'],
                                  constants.PUBLIC_OVERLAYS, error)
             elif cbuildbot_config.IsCQType(config['build_type']):
                 self.assertEqual(config['overlays'],
                                  constants.BOTH_OVERLAYS, error)