Exemple #1
0
def _internal_simple(path, project_bases, user, root_dir, rietveld_obj):
  """Generates a PendingManager commit queue for chrome/trunk/tools/build."""
  local_checkout = checkout.SvnCheckout(
      root_dir,
      os.path.basename(path),
      user,
      None,
      'svn://svn.chromium.org/chrome/trunk/' + path,
      [chromium_copyright.process])
  context_obj = context.Context(
      rietveld_obj,
      local_checkout,
      async_push.AsyncPush(
        'https://chromium-status.appspot.com/cq',
        _chromium_status_pwd(root_dir)))

  verifiers_no_patch = [
      project_base.ProjectBaseUrlVerifier(project_bases),
      reviewer_lgtm.ReviewerLgtmVerifier(
          _get_chromium_committers(),
          [re.escape(user)]),
  ]
  verifiers = [
      presubmit_check.PresubmitCheckVerifier(context_obj, timeout=900),
  ]

  return pending_manager.PendingManager(
      context_obj,
      verifiers_no_patch,
      verifiers)
Exemple #2
0
 def _check(self, error_message=None, expiration=None):
   # checkout is not used yet. To be used to get the list of modified files.
   ver = presubmit_check.PresubmitCheckVerifier(self.context)
   if expiration:
     ver.execution_timeout = expiration
   ver.verify(self.pending)
   ver.update_status(None)
   name = presubmit_check.PresubmitCheckVerifier.name
   self.assertEqual(self.pending.verifications.keys(), [name])
   if error_message:
     self.assertIn(
         error_message, self.pending.verifications[name].error_message)
     self.assertEqual(
         self.pending.verifications[name].get_state(), base.FAILED)
     self.assertIn(error_message, self.pending.error_message())
   else:
     self.assertEqual(None, self.pending.verifications[name].error_message)
     self.assertEqual(
         self.pending.verifications[name].get_state(), base.SUCCEEDED)
     self.assertEqual('', self.pending.error_message())
   self.context.status.check_names(['presubmit'] * 2)
Exemple #3
0
def _gen_nacl(user, root_dir, rietveld_obj, no_try):
  """Generates a PendingManager commit queue for Native Client."""
  offset = 'trunk/src/native_client'
  local_checkout = checkout.SvnCheckout(
      root_dir,
      'nacl',
      user,
      None,
      'svn://svn.chromium.org/native_client/' + offset)
  context_obj = context.Context(
      rietveld_obj,
      local_checkout,
      async_push.AsyncPush(
        'https://nativeclient-status.appspot.com/cq',
        _chromium_status_pwd(root_dir)))

  host_aliases = SVN_HOST_ALIASES + [
      'http://src.chromium.org', 'https://src.chromium.org']
  svn_bases = [i + '/native_client' for i in host_aliases]
  project_bases = [
      '^%s/%s(|/.*)$' % (re.escape(base), offset) for base in svn_bases
  ]
  aliases = (
    'git.chromium.org/native_client/src/native_client',
    'chromium.googlesource.com/native_client/src/native_client',
  )
  project_bases.extend(
      r'^https?\:\/\/%s(?:\.git)?%s$' % (re.escape(i), BRANCH_MATCH)
      for i in aliases)
  verifiers_no_patch = [
      project_base.ProjectBaseUrlVerifier(project_bases),
      reviewer_lgtm.ReviewerLgtmVerifier(
          _get_nacl_committers(),
          [re.escape(user)]),
  ]
  verifiers = [
      presubmit_check.PresubmitCheckVerifier(context_obj),
  ]
  if not no_try:
    # Grab the list of all the builders here. The commit queue needs to know
    # which builders were triggered. TODO: makes this more automatic.
    url = 'http://build.chromium.org/p/tryserver.nacl/json/builders'
    builders_and_tests = dict(
      (key, []) for key in json.load(urllib2.urlopen(url))
      if (key.startswith('nacl-') and
          'toolchain' not in key and
          'valgrind' not in key and
          'perf_panda' not in key and
          'arm_hw' not in key and
          'shared' not in key and
          'coverage' not in key)
    )
    verifiers.append(try_server.TryRunnerSvn(
        context_obj,
        'http://build.chromium.org/p/tryserver.nacl/',
        user,
        builders_and_tests,
        IGNORED_STEPS,
        'native_client',
        ['--root', 'native_client'],
        _nacl_lkgr))

  verifiers.append(tree_status.TreeStatusVerifier(
      'https://nativeclient-status.appspot.com'))
  return pending_manager.PendingManager(
      context_obj,
      verifiers_no_patch,
      verifiers)
Exemple #4
0
def _gen_skia(user, root_dir, rietveld_obj, no_try):
  """Generates a PendingManager commit queue for Skia.

  Adds the following verifiers to the PendingManager:
  * ProjectBaseUrlVerifier
  * ReviewerLgtmVerifier
  * PresubmitCheckVerifier
  * TreeStatusVerifier
  * TryRunnerRietveld (runs compile trybots)
  """
  naked_url = '://skia.googlecode.com/svn/trunk'
  local_checkout = checkout.SvnCheckout(
      root_dir,
      'skia',
      user,
      None,
      'https' + naked_url)
  context_obj = context.Context(
      rietveld_obj,
      local_checkout,
      async_push.AsyncPush(
          'https://skia-tree-status.appspot.com/cq',
          _skia_status_pwd(root_dir)),
      server_hooks_missing=True)

  project_bases = [
      '^%s(|/.*)$' % re.escape(base + naked_url) for base in ('http', 'https')
  ]
  verifiers_no_patch = [
      project_base.ProjectBaseUrlVerifier(project_bases),
      reviewer_lgtm.ReviewerLgtmVerifier(
          _get_skia_committers(),
          [re.escape(user)]),
  ]
  verifiers = [
      presubmit_check.PresubmitCheckVerifier(context_obj),
      tree_status.TreeStatusVerifier(
          'https://skia-tree-status.appspot.com')
  ]

  if not no_try:
    # TODO(rmistry): This should instead be a URL that does not change.
    try_server_url = 'http://108.170.217.252:10117/'
    compile_required_build_steps = [
        'BuildBench',
        'BuildGm',
        'BuildMost',
        'BuildSkiaLib',
        'BuildTests',
        'BuildTools',
    ]

    builder_names = list(
        json.load(urllib2.urlopen(try_server_url + 'json/cqtrybots')))

    step_verifiers = []
    for builder_name in builder_names:
      step_verifiers.append(
          try_job_steps.TryJobSteps(
              builder_name=builder_name,
              steps=compile_required_build_steps))
    verifiers.append(try_job_on_rietveld.TryRunnerRietveld(
          context_obj=context_obj,
          try_server_url=try_server_url,
          commit_user=user,
          step_verifiers=step_verifiers,
          ignored_steps=[],
          solution='src'))

  return pending_manager.PendingManager(
      context_obj,
      verifiers_no_patch,
      verifiers)
Exemple #5
0
def _gen_chromium(user, root_dir, rietveld_obj, no_try):
    """Generates a PendingManager commit queue for chrome/trunk/src."""
    svn_creds = creds.Credentials(os.path.join(root_dir, '.svn_pwd'))
    local_checkout = checkout.SvnCheckout(
        root_dir, 'chromium', user, svn_creds.get(user),
        'svn://svn.chromium.org/chrome/trunk/src',
        [chromium_copyright.process])
    context_obj = context.Context(
        rietveld_obj, local_checkout,
        async_push.AsyncPush('https://chromium-status.appspot.com/cq',
                             _chromium_status_pwd(root_dir)))

    project_bases = [
        '^%s/trunk/src(|/.*)$' % re.escape(base) for base in CHROME_SVN_BASES
    ]

    aliases = (
        # Old path.
        'git.chromium.org/git/chromium.git',
        # New path.
        'git.chromium.org/chromium/src.git',
        'git.chromium.org/git/chromium/src',
        'git.chromium.org/git/chromium/src.git',
    )
    aliases_urls = sum((['https://' + i, 'http://' + i] for i in aliases), [])
    project_bases.extend(r'^%s\@[a-z\-_]+$' % re.escape(i)
                         for i in aliases_urls)
    verifiers_no_patch = [
        project_base.ProjectBaseUrlVerifier(project_bases),
        reviewer_lgtm.ReviewerLgtmVerifier(_get_chromium_committers(),
                                           [re.escape(user)]),
    ]
    verifiers = [
        presubmit_check.PresubmitCheckVerifier(context_obj),
    ]
    if not no_try:
        # To add tests to this list, they MUST be in
        # /chrome/trunk/tools/build/masters/master.chromium/master_gatekeeper_cfg.py
        # or somehow close the tree whenever they break.
        standard_tests = (
            'base_unittests',
            'browser_tests',
            'check_deps',
            'cacheinvalidation_unittests',
            'chrome_frame_net_tests',
            'chrome_frame_unittests',
            'content_unittests',
            'crypto_unittests',
            'gfx_unittests',
            # Broken in release.
            #'googleurl_unittests',
            'gpu_unittests',
            'ipc_tests',
            'interactive_ui_tests',
            'installer_util_unittests',
            'jingle_unittests',
            'media_unittests',
            'mini_installer_test',
            #'nacl_integration',
            'net_unittests',
            'printing_unittests',
            # Too flaky.
            #'pyauto_functional_tests',
            'remoting_unittests',
            'safe_browsing_tests',
            'sql_unittests',
            'sync_unit_tests',
            # Tends to be broken by webkit roll and not fixed fast enough.
            #'test_shell_tests',
            'unit_tests',
            'ui_tests',
            'views_unittests',
            #'webkit_unit_tests',
        )
        builders_and_tests = {
            # TODO(maruel): Figure out a way to run 'sizes' where people can
            # effectively update the perf expectation correctly.  This requires a
            # clobber=True build running 'sizes'. 'sizes' is not accurate with
            # incremental build. Reference:
            # http://chromium.org/developers/tree-sheriffs/perf-sheriffs.
            # TODO(maruel): An option would be to run 'sizes' but not count a failure
            # of this step as a try job failure.
            'linux_rel': standard_tests,
            'mac_rel': standard_tests,
            'win_rel': standard_tests,
            'win': ['compile'],
            'linux_clang': ['compile'],
            'linux_chromeos': ['compile'],
            # tests are ignored for the annotated build of android trybots at this
            # time.
            'android': [],
        }
        verifiers.append(
            try_server.TryRunner(
                context_obj, 'http://build.chromium.org/p/tryserver.chromium/',
                user, builders_and_tests, IGNORED_STEPS, ['--root', 'src'],
                _chromium_lkgr, 'src'))

    verifiers.append(
        tree_status.TreeStatusVerifier('http://chromium-status.appspot.com'))
    return pending_manager.PendingManager(context_obj, verifiers_no_patch,
                                          verifiers)