Esempio n. 1
0
def SubmitTryJobChanges(self, changes):
  """ Override of SVNPoller.submit_changes:
  http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/master/try_job_svn.py?view=markup

  We modify it so that the patch file url is added to the build properties.
  This allows the slave to download the patch directly rather than receiving
  it from the master.
  """
  for chdict in changes:
    # pylint: disable=E1101
    parsed = self.parent.parse_options(text_to_dict(chdict['comments']))

    # 'fix' revision.
    # LKGR must be known before creating the change object.
    wfd = defer.waitForDeferred(self.parent.get_lkgr(parsed))
    yield wfd
    wfd.getResult()

    wfd = defer.waitForDeferred(self.master.addChange(
      author=','.join(parsed['email']),
      revision=parsed['revision'],
      comments='',
      properties={'patch_file_url': chdict['repository'] + '/' + \
                      chdict['files'][0]}))
    yield wfd
    change = wfd.getResult()

    self.parent.addChangeInner(chdict['files'], parsed, change.number)
Esempio n. 2
0
def SubmitTryJobChanges(self, changes):
    """ Override of SVNPoller.submit_changes:
  http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/master/try_job_svn.py?view=markup

  We modify it so that the patch file url is added to the build properties.
  This allows the slave to download the patch directly rather than receiving
  it from the master.
  """
    for chdict in changes:
        # pylint: disable=E1101
        parsed = self.parent.parse_options(text_to_dict(chdict['comments']))

        # 'fix' revision.
        # LKGR must be known before creating the change object.
        wfd = defer.waitForDeferred(self.parent.get_lkgr(parsed))
        yield wfd
        wfd.getResult()

        wfd = defer.waitForDeferred(self.master.addChange(
          author=','.join(parsed['email']),
          revision=parsed['revision'],
          comments='',
          properties={'patch_file_url': chdict['repository'] + '/' + \
                          chdict['files'][0]}))
        yield wfd
        change = wfd.getResult()

        self.parent.addChangeInner(chdict['files'], parsed, change.number)
Esempio n. 3
0
 def testParseText(self):
     text = ('foo=bar\n'
             '\n'
             'Ignored text\n'
             'ignored_key=\n'
             '=ignored_value\n'
             'DUPE=dupe1\n'
             'DUPE=dupe2\n')
     expected = {
         'foo': ['bar'],
         'DUPE': ['dupe1', 'dupe2'],
     }
     self.assertEquals(expected, try_job_base.text_to_dict(text))
Esempio n. 4
0
 def testParseText(self):
   text = (
       'foo=bar\n'
       '\n'
       'Ignored text\n'
       'ignored_key=\n'
       '=ignored_value\n'
       'DUPE=dupe1\n'
       'DUPE=dupe2\n')
   expected = {
       'foo': ['bar'],
       'DUPE': ['dupe1', 'dupe2'],
   }
   self.assertEquals(expected, try_job_base.text_to_dict(text))
Esempio n. 5
0
  def process_commit(self, author, revision, files, comments, when_timestamp,
                     revlink):
    log.msg('TryJobGit: processing change %s' % revision)
    # pylint: disable=E1101
    options = self.parse_options(text_to_dict(comments))

    # Read ref name from the 'ref' file in the master branch.
    # A slave will pull this ref.
    wfd = defer.waitForDeferred(
        self.getProcessOutput(['show', '%s:ref' % revision]))
    yield wfd
    options['patch_ref'] = wfd.getResult()
    options['patch_repo_url'] = self.git_url
    options['patch_storage'] = 'git'

    self.addJob(options)
Esempio n. 6
0
  def submit_changes(self, changes):
    """Instead of submitting the changes to the master, pass them to
    TryJobSubversion. We don't want buildbot to see these changes.
    """
    for chdict in changes:
      # pylint: disable=E1101
      parsed = self.parent.parse_options(text_to_dict(chdict['comments']))

      # 'fix' revision.
      # LKGR must be known before creating the change object.
      wfd = defer.waitForDeferred(self.parent.get_lkgr(parsed))
      yield wfd
      wfd.getResult()

      wfd = defer.waitForDeferred(self.master.addChange(
        author=','.join(parsed['email']),
        revision=parsed['revision'],
        comments=''))
      yield wfd
      change = wfd.getResult()

      self.parent.addChangeInner(chdict['files'], parsed, change.number)
Esempio n. 7
0
    def process_svn_changes(self, changes):
        """For each change submit a job"""
        for change in changes:
            # pylint: disable=E1101
            options = self.parse_options(text_to_dict(change['comments']))

            # Generate patch_url.
            diff_filename = findSingleDiff(change['files'])
            patch_url = ('%s/%s@%s' %
                         (self.watcher.svnurl, urllib.quote(diff_filename),
                          change['revision']))
            options['patch_url'] = patch_url
            options['patch_storage'] = 'svn'

            # Read patch contents.
            wfd = defer.waitForDeferred(
                self.watcher.getProcessOutput(
                    ['cat', patch_url, '--non-interactive']))
            yield wfd
            options['patch'] = wfd.getResult()

            self.addJob(options)
Esempio n. 8
0
  def process_svn_changes(self, changes):
    """For each change submit a job"""
    for change in changes:
      # pylint: disable=E1101
      options = self.parse_options(text_to_dict(change['comments']))

      # Generate patch_url.
      diff_filename = findSingleDiff(change['files'])
      patch_url = ('%s/%s@%s' % (
          self.watcher.svnurl,
          urllib.quote(diff_filename),
          change['revision'])
      )
      options['patch_url'] = patch_url
      options['patch_storage'] = 'svn'

      # Read patch contents.
      wfd = defer.waitForDeferred(self.watcher.getProcessOutput(
          ['cat', patch_url, '--non-interactive']))
      yield wfd
      options['patch'] = wfd.getResult()

      self.addJob(options)
Esempio n. 9
0
    def submit_changes(self, changes):
        """Instead of submitting the changes to the master, pass them to
    TryJobSubversion. We don't want buildbot to see these changes.
    """
        for chdict in changes:
            # pylint: disable=E1101
            parsed = self.parent.parse_options(text_to_dict(
                chdict['comments']))

            # 'fix' revision.
            # LKGR must be known before creating the change object.
            wfd = defer.waitForDeferred(self.parent.get_lkgr(parsed))
            yield wfd
            wfd.getResult()

            wfd = defer.waitForDeferred(
                self.master.addChange(author=','.join(parsed['email']),
                                      revision=parsed['revision'],
                                      comments=''))
            yield wfd
            change = wfd.getResult()

            self.parent.addChangeInner(chdict['files'], parsed, change.number)