Exemplo n.º 1
0
 def testCompileFailure(self, mock_analyzer, _):
     build = Build()
     step = build.steps.add()
     step.name = 'compile'
     step.status = common_pb2.FAILURE
     self.assertTrue(api.OnBuildFailure(self.context, build))
     mock_analyzer.assert_called_once_with(self.context, build, [step])
Exemplo n.º 2
0
def OnSupportedBuildCompletion(project, bucket, builder_name, build_id,
                               build_result):
    """Processes a completed build from a builder Findit is supporting.

  Args:
    project (str): Luci project of the build.
    build_id (int): Id of the build.

  Returns:
    False if it is unsupported or skipped; otherwise True.
  """
    if build_result != 'FAILURE':
        # Skip builds that didn't fail.
        logging.debug('Build %s/%s/%s/%s is not a failure', project, bucket,
                      builder_name, build_id)
        return False

    build, context = GetBuildAndContextForAnalysis(project, build_id)
    if not build:
        return False

    detection_api.OnBuildFailure(context, build)
    return True
Exemplo n.º 3
0
 def testTestFailure(self, *_):
   build = Build()
   step = build.steps.add()
   step.name = 'test'
   step.status = common_pb2.FAILURE
   self.assertFalse(api.OnBuildFailure(self.context, build))
Exemplo n.º 4
0
 def testNoValidFailure(self, *_):
   build = Build()
   step = build.steps.add()
   step.name = 'compile'
   step.status = common_pb2.INFRA_FAILURE
   self.assertFalse(api.OnBuildFailure(self.context, build))