Exemple #1
0
 def _MockExtractBuildInfo(*_):
     build_info = BuildInfo('m', 'b', 25409)
     build_info.failed_steps = {
         'compile': {
             'last_pass': '******',
             'current_failure': '25409',
             'first_failure': '25409'
         }
     }
     return build_info
Exemple #2
0
 def testGetFailureType(self):
     cases = {
         failure_type.UNKNOWN: [],
         failure_type.COMPILE: ['compile', 'slave_steps'],
         failure_type.TEST: ['browser_tests'],
     }
     for expected_type, failed_steps in cases.iteritems():
         build_info = BuildInfo('m', 'b', 123)
         build_info.failed_steps = failed_steps
         self.assertEqual(
             expected_type,
             detect_first_failure_pipeline._GetFailureType(build_info))
Exemple #3
0
 def testGetFailureTypeCompile(self):
     build_info = BuildInfo('m', 'b', 123)
     build_info.failed_steps = ['compile']
     self.assertEqual(failure_type.COMPILE,
                      build_util.GetFailureType(build_info))
Exemple #4
0
 def testGetFailureTypeTest(self):
     build_info = BuildInfo('m', 'b', 123)
     build_info.failed_steps = ['abc_tests']
     self.assertEqual(failure_type.TEST,
                      build_util.GetFailureType(build_info))
Exemple #5
0
 def testGetFailureTypeInfra(self):
     build_info = BuildInfo('m', 'b', 123)
     build_info.result = common_pb2.INFRA_FAILURE
     build_info.failed_steps = ['compile']
     self.assertEqual(failure_type.INFRA,
                      build_util.GetFailureType(build_info))