def projectFailTest(): gitConnection = GitConnect() gitConnection.checkForUnsavedChanges() reasons = {"0":"Failed a unit test.","1":"Failed a UI test"} for reason in reasons.keys(): print reason," ",reasons[reason] print "Or just type why it failed." reason = raw_input() if reason in reasons.keys(): reason = reasons[reason] purgatory = False else: purgatory = True caseno = gitConnection.extractCaseFromBranch() gitConnection.pushChangesToOriginBranch(gitConnection.getBranch()) gitConnection.checkoutMaster() fbConnection = FogBugzConnect() (parent,test) = fbConnection.getCaseTuple(caseno) if purgatory: fbConnection.commentOn(parent,PURGATORY_STMT) #this signals buildbot to fail the case back to the implementer after PURGATORY expires #buildbot special-cases Inspect passes to be in PURGATORY, so no signaling is required for the pass case fbConnection.fbConnection.assign(ixBug=parent,ixPersonAssignedTo=magic.BUILDBOT_IXPERSON,sEvent="Terribly sorry but your case FAILED a test: %s" % reason) fbConnection.stopWork(test) # play sounds! getstatusoutput ("afplay -v 7 %s/media/dundundun.aiff" % sys.prefix)
def projectStop(): #create new gitConnect object to talk to git gitConnection = GitConnect() #check for unsaved changes to source code gitConnection.checkForUnsavedChanges() #create new FogBugzConnect object to talk to FBAPI fbConnection = FogBugzConnect() caseno = gitConnection.extractCaseFromBranch() #stop working on case and checkout master branch = gitConnection.getBranch() gitConnection.pushChangesToOriginBranch(branch) gitConnection.checkoutMaster() #clock out of project fbConnection.stopWork(caseno)