def _TestOwners(stoppage_alerts):
  """Returns a list of test owners for the given alerts."""
  def SuitePath(alert):
    path_parts = utils.TestPath(alert.test).split('/')
    return '%s/%s' % (path_parts[0], path_parts[2])
  test_owners = test_owner.GetOwners([SuitePath(a) for a in stoppage_alerts])
  return ','.join(test_owners)
Esempio n. 2
0
def _GetOwnerInfo(alert_dicts):
  """Gets a list of owner info for list of alerts for bug with bisect result.

  Test owners are retrieved by a set of master and test suite name from each
  alert in alert_dicts.

  Args:
    alert_dicts: List of alert data dictionaries.

  Returns:
    A list of dictionary containing owner information.
  """
  test_suite_paths = {'%s/%s' % (a['master'], a['testsuite'])
                      for a in alert_dicts}
  owners = test_owner.GetOwners(test_suite_paths)
  return [{'email': owner} for owner in owners]
Esempio n. 3
0
 def testGetOwners(self):
     layered_cache.SetExternal(test_owner._MASTER_OWNER_CACHE_KEY,
                               _SAMPLE_OWNER_DICT)
     test_suite_paths = ['ChromiumPerf/speedometer', 'ChromiumPerf/octane']
     owners = test_owner.GetOwners(test_suite_paths)
     self.assertEqual(['*****@*****.**', '*****@*****.**'], owners)