[Buildbot-devel] slave causes master-reconfig (recipe)

Mike Winter (miwinter) miwinter at cisco.com
Tue Jul 21 15:35:32 UTC 2009


def glob2runTests(rc, stdout, stderr):
    '''parse stdout lines to parse a new set of runtests for a branch
    if the runtests differs from the local record, then save to the
local record then do a reconfig
    master.cfg will load the pickle to build the buildstep-cells it will
run.
    '''
    lines = [l.strip() for l in stdout.split('\n') ]
    runtests = {}
    branch = None
    for line in lines:
        if line.startswith('branch: '):
            # found a new defn of runtests to run! runtests.<branch>=
            parts = line.split(" ",1)
            branch = parts[1]
        if line.startswith('runtests: '):
            parts = line.split(" ",1)
            runtests = parts[1]
            print 'runtests: >>>>>%s<<<<<' % runtests
            #different?
            # then convert to dict and pickle locally and call reconfig
            master_runtests = properties.runTests
            old_runtests = {}
            if branch in master_runtests:
                old_runtests = master_runtests[branch]
            if str(old_runtests) != runtests:
                runtest_dict= eval(runtests)
                properties.doPickle(branch, runtest_dict)
                os.system('make reconfig')


Def makeFactory()
    f = factory.BuildFactory()
    f.addStep(SetProperty(name='runtest finder',
           	                    command='./runtests.py -b %s' %
branch, extract_fn=glob2runTests),
                     workdir='test')
    return f




More information about the devel mailing list