Beispiel #1
0
    def testBailOutIfNotAFailedBuild(self):
        failure_info = {
            'failed': False,
        }
        expected_change_logs = {}

        pipeline = PullChangelogPipeline()
        change_logs = pipeline.run(failure_info)
        self.assertEqual(expected_change_logs, change_logs)
  def testBailOutIfNotAFailedBuild(self):
    failure_info = {
        'failed': False,
    }
    expected_change_logs = {}

    pipeline = PullChangelogPipeline()
    change_logs = pipeline.run(failure_info)
    self.assertEqual(expected_change_logs, change_logs)
  def testBailOutIfNoValidChromiumRevision(self):
    failure_info = {
        'failed': True,
        'chromium_revision': None,
    }
    expected_change_logs = {}

    pipeline = PullChangelogPipeline()
    change_logs = pipeline.run(failure_info)
    self.assertEqual(expected_change_logs, change_logs)
Beispiel #4
0
    def testBailOutIfNoValidChromiumRevision(self):
        failure_info = {
            'failed': True,
            'chromium_revision': None,
        }
        expected_change_logs = {}

        pipeline = PullChangelogPipeline()
        change_logs = pipeline.run(failure_info)
        self.assertEqual(expected_change_logs, change_logs)
    def testBailOutIfInfraFailure(self):
        failure_info = {
            'failed': True,
            'chromium_revision': '00baf00ba',
            'failure_type': failure_type.INFRA
        }
        expected_change_logs = {}

        pipeline = PullChangelogPipeline()
        change_logs = pipeline.run(failure_info)
        self.assertEqual(expected_change_logs, change_logs)
Beispiel #6
0
    def testPullChangelogs(self):
        with self.mock_urlfetch() as urlfetch:
            urlfetch.register_handler(REV1_COMMIT_JSON_URL, REV1_COMMIT_LOG)

        failure_info = {
            'failed': True,
            'chromium_revision': 'rev1',
            'builds': {
                '999': {
                    'blame_list': ['rev1']
                }
            }
        }

        expected_change_logs = {
            'rev1': {
                'author_name':
                '*****@*****.**',
                'message':
                'git-svn-id: svn://svn.chromium.org/chromium/src@175976 blabla',
                'committer_email':
                '*****@*****.**',
                'commit_position':
                175976,
                'author_email':
                '*****@*****.**',
                'touched_files': [{
                    'new_path': 'added_file.js',
                    'change_type': 'add',
                    'old_path': '/dev/null'
                }],
                'author_time':
                datetime.strptime('Wed Jun 11 19:35:32 2014',
                                  '%a %b %d %H:%M:%S %Y'),
                'committer_time':
                datetime.strptime('Wed Jun 11 19:35:32 2014',
                                  '%a %b %d %H:%M:%S %Y'),
                'commit_url':
                REV1_COMMIT_LOG_URL,
                'code_review_url':
                None,
                'committer_name':
                '*****@*****.**',
                'revision':
                'rev1'
            }
        }

        pipeline = PullChangelogPipeline()
        change_logs = pipeline.run(failure_info)
        self.assertEqual(expected_change_logs, change_logs)
  def testPullChangelogs(self):
    with self.mock_urlfetch() as urlfetch:
      urlfetch.register_handler(REV1_COMMIT_JSON_URL, REV1_COMMIT_LOG)

    failure_info = {
      'failed': True,
      'chromium_revision': 'rev1',
      'builds': {
        '999': {
          'blame_list': ['rev1']
        }
      }
    }

    expected_change_logs = {
      'rev1': {
        'author_name': '*****@*****.**',
        'message':
          'git-svn-id: svn://svn.chromium.org/chromium/src@175976 blabla',
        'committer_email': '*****@*****.**',
        'commit_position': 175976,
        'author_email': '*****@*****.**',
        'touched_files': [
          {
            'new_path': 'added_file.js',
            'change_type': 'add',
            'old_path': '/dev/null'
          }
        ],
        'author_time': datetime.strptime('Wed Jun 11 19:35:32 2014',
            '%a %b %d %H:%M:%S %Y'),
        'committer_time': datetime.strptime('Wed Jun 11 19:35:32 2014',
            '%a %b %d %H:%M:%S %Y'),
        'commit_url': REV1_COMMIT_LOG_URL,
        'code_review_url': None,
        'committer_name': '*****@*****.**',
        'revision': 'rev1',
        'reverted_revision': None
      }
    }

    pipeline = PullChangelogPipeline()
    change_logs = pipeline.run(failure_info)
    self.assertEqual(expected_change_logs, change_logs)