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

Doug Latornell djl at douglatornell.ca
Wed Oct 13 19:39:07 UTC 2010


I do something similar in my builders. In my case I want to skip
certain steps if a property has been set. I use a custom ShellCommand
with code like this in the start() method:

def start(self):
    ...
    if self.getProperty('make_refs'):
        return SKIPPED
    else:
        ShellCommand.start(self)

I think you should be able to set self.haltOnFailure as you wish in
the clauses of the if/else.

Doug

On Wed, Oct 13, 2010 at 9:39 AM, robert dugal <rmdugal at hotmail.com> wrote:
>
> 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 ))
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>




More information about the devel mailing list