예제 #1
0
def OnTestRerunBuildCompletion(context, rerun_build):
  """Processes the completed rerun build then continues the analysis.

  Processes and stores results of the completed rerun build. And then resume the
  analysis to either start the next rerun build or identify the culprit.

  Args:
    context (findit_v2.services.context.Context): Scope of the analysis.
    rerun_build (buildbucket build.proto): ALL info about the rerun build.

  Returns:
    True if the rerun build entity is updated, otherwise False.
  """
  analyzed_build_id = build_util.GetAnalyzedBuildIdFromRerunBuild(rerun_build)
  if not analyzed_build_id:
    logging.error('analyzed_build_id not set in the rerun build %d.',
                  rerun_build.id)
    return False

  build_saved = _ProcessAndSaveRerunBuildResult(context, analyzed_build_id,
                                                rerun_build)
  if not build_saved:
    return False

  TestAnalysisAPI().RerunBasedAnalysis(context, analyzed_build_id)
  return True
예제 #2
0
 def testGetAnalyzedBuildIdFromRerunBuild(self):
     analyzed_build_id = 8000000000123
     build = Build(tags=[{
         'key': 'analyzed_build_id',
         'value': str(analyzed_build_id)
     }])
     self.assertEqual(analyzed_build_id,
                      build_util.GetAnalyzedBuildIdFromRerunBuild(build))
예제 #3
0
 def testGetAnalyzedBuildIdFromRerunBuildNoAnalyzedBuildId(self):
     self.assertIsNone(build_util.GetAnalyzedBuildIdFromRerunBuild(Build()))