[Buildbot-devel] Running a buildstep only if previous steps completed successfully.

Mike Winter miwinter at cisco.com
Sun Sep 19 02:55:15 UTC 2010


I find that doStepIf is best set as a callback fn, but It might be overkill, depending on your specific requirements!

def checkForSkipOrRun(step):
    props = step.build.getProperties()
    twlog.msg('checkForSkipOrRun: step: %s props: %s' % (step.name, props))

    if props.has_key('NO_ACME') and isinstance(step,ACME):
        return False

    keys = ['NO_%s' % step.name, 'NO%s' % step.name, 'no%s' % step.name]
    if props.has_key(keys[0]) or props.has_key(keys[1]) or props.has_key(keys[2]):
        return False

    if props.has_key('ONE_STEP'):
        return step.name == props['ONE_STEP']

    if props.has_key('SOME_STEPS_SUBSTR'):
        return step.name.find(props['SOME_STEPS_SUBSTR']) != -1

    return True

[snip]
   factory.addStep(ShellCommand(name=name,
                           command =["./runTests.sh", verbose, 
                                               "--report", "no", 
                                               "--test", "%s/%s" % (component, v)],
                           workdir ="build/test",
                           timeout =timeout,
                           locks =locks,
                           description ="runtests in %s/%s" % (component, v),
                           doStepIf =checkForSkipOrRun))
   

On 09/08/2010 12:27 PM, Tjf wrote:
> Hi Scott!
> 
> I think you just want to set the 'haltOnFailure' property to true on each of those
> Build steps.

Hi Tom,

Thanks for the reply, but unfortunately this will not work, as I would 
still like the full buildset to run even if there are individual failures.

To give this a bit more context, what I'm trying to run is an automated 
bug processing script which will change the state of several bugs to 
notify our QA team when they need to review a build for regression bugs.

I only want this notification to be triggered if all of the buildsteps 
to that point succeeded. Otherwise, I still want the other buildsteps to 
run so we can gather information about the state of our builds for 
bugfixing - but in that case I do not want my bug processing script to run.

Thanks,

Scott

-- 
Scott Garman
sgarman at zenlinux dot com

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
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