def testUpdateSuspectedCLCorrect(self):
    suspected_cl = WfSuspectedCL.Create(
        self.repo_name, self.revision_1, self.commit_position)

    suspected_cl.builds = {
        self.build_key_1: {
            'failure_type': 'test',
            'failures': {
                's1': ['t1', 't2']
            },
            'status': None,
            'approaches': [analysis_approach_type.HEURISTIC,
                           analysis_approach_type.TRY_JOB],
            'top_score': None,
            'Confidence': 80.0
        }
    }
    suspected_cl.put()

    cl_status = suspected_cl_status.CORRECT
    triage_suspected_cl._UpdateSuspectedCL(
        self.repo_name, self.revision_1, self.build_key_1, cl_status)

    suspected_cl = WfSuspectedCL.Get(self.repo_name, self.revision_1)

    self.assertEqual(
        suspected_cl.builds[self.build_key_1]['status'], cl_status)
    self.assertEqual(suspected_cl.status, cl_status)
Пример #2
0
  def testUpdateSuspectedCLNonFirstTimeFailure(self):
    suspected_cl = WfSuspectedCL.Create(self.repo_name, self.revision_1,
                                        self.commit_position)

    suspected_cl.builds = {
        self.build_key_1: {
            'failure_type':
                'test',
            'failures': {
                's1': ['t1', 't2']
            },
            'status':
                None,
            'approaches': [
                analysis_approach_type.HEURISTIC, analysis_approach_type.TRY_JOB
            ],
            'top_score':
                None,
            'Confidence':
                80.0
        }
    }
    suspected_cl.put()
    self.assertTrue(
        triage_suspected_cl._UpdateSuspectedCL(self.repo_name, self.revision_1,
                                               self.build_key_2, None))