def testStepDoneFailOverridesWarnings(self): r = FakeRequest() b = Build([r]) b.results = [SUCCESS, WARNINGS] b.result = WARNINGS b.remote = Mock() step = FakeBuildStep() terminate = b.stepDone(FAILURE, step) self.assertEqual(terminate, False) self.assertEqual(b.result, FAILURE)
def testStepDoneWarningsDontOverrideFailure(self): r = FakeRequest() b = Build([r]) b.results = [FAILURE] b.result = FAILURE b.remote = Mock() step = FakeBuildStep() terminate = b.stepDone(WARNINGS, step) self.assertEqual(terminate, False) self.assertEqual(b.result, FAILURE)
def testStepDoneFail(self): r = FakeRequest() b = Build([r]) b.results = [SUCCESS] b.result = SUCCESS b.remote = Mock() step = FakeBuildStep() terminate = b.stepDone(FAILURE, step) self.assertEqual(terminate, False) self.assertEqual(b.result, FAILURE)
def testStepDoneWarnings(self): r = FakeRequest() b = Build([r]) b.results = [SUCCESS] b.result = SUCCESS b.remote = Mock() step = FakeBuildStep() terminate = b.stepDone(WARNINGS, step) self.assertEqual(terminate, False) self.assertEqual(b.result, WARNINGS)
def testStepDoneHaltOnFailure(self): r = FakeRequest() b = Build([r]) b.results = [] b.result = SUCCESS b.remote = Mock() step = FakeBuildStep() step.haltOnFailure = True terminate = b.stepDone(FAILURE, step) self.assertEqual(terminate, True) self.assertEqual(b.result, FAILURE)
def testStepDoneHaltOnFailureFlunkOnWarnings(self): r = FakeRequest() b = Build([r]) b.results = [SUCCESS] b.result = SUCCESS b.remote = Mock() step = FakeBuildStep() step.flunkOnWarnings = True self.haltOnFailure = True terminate = b.stepDone(WARNINGS, step) self.assertEqual(terminate, False) self.assertEqual(b.result, FAILURE)
def testStepDoneWarnOnFailure(self): r = FakeRequest() b = Build([r]) b.results = [SUCCESS] b.result = SUCCESS b.remote = Mock() step = FakeBuildStep() step.warnOnFailure = True step.flunkOnFailure = False terminate = b.stepDone(FAILURE, step) self.assertEqual(terminate, False) self.assertEqual(b.result, WARNINGS)
def testStepDoneRetryOverridesAnythingElse(self): r = FakeRequest() b = Build([r]) b.results = [RETRY] b.result = RETRY b.remote = Mock() step = FakeBuildStep() step.alwaysRun = True b.stepDone(WARNINGS, step) b.stepDone(FAILURE, step) b.stepDone(SUCCESS, step) terminate = b.stepDone(EXCEPTION, step) self.assertEqual(terminate, True) self.assertEqual(b.result, RETRY)