[Buildbot-devel] is there a way to set haltOnFailure at build time?

robert dugal rmdugal at hotmail.com
Wed Oct 13 16:39:01 UTC 2010


Is it possible to set haltOnFailure to the result of some function, such as one that checks if a property exists?
I have a builder that creates a package that is used by other builders. The builder has unit tests that are sometimes failing which causes the builder to not produce a build package.
This prevents the other builders from working. There's nothing wrong with this design and it is the proper way things should work.

However, there are sometimes special instances where I want the unit tests failures to be ignored and produce a package anyways, so I can run the other builders. 
I was hoping I could set haltOnFailure=False when some property like IGNORE_UNIT_TEST_FAILURES was defined in the force build web page.
However it doesn't seem to work.

Any suggestions on how to accomplish this?

def TryThis(step):
    """
    
    """
   
    result = True
    properties = step.build.getProperties()
    if properties.has_key('IGNORE_UNIT_TEST_FAILURES'):
            result = False
    return result

class DummyFactory(BuildFactory):
    def __init__(self, 
                final_empty=False,
                **kwargs):
        BuildFactory.__init__(self)
        self.addStep(ShellCommand(name='T1', command="ls foobar/", haltOnFailure=TryThis, flunkOnFailure=TryThis ))
        self.addStep(ShellCommand(name='T2', command="ls", haltOnFailure=True ))

 		 	   		  



More information about the devel mailing list