[Buildbot-devel] Out of order steps in waterfall?
Rene Rivera
grafik.list at redshift-software.com
Wed Apr 13 20:06:00 UTC 2005
Brian Warner wrote:
>>But I have existing steps after the new steps I'm inserting. This
>>causes the waterfall to show steps not in the order they got executed
>>but in the order they got added to the build status object.
>>
>>Any way of fixing this?
Re-arranging your reply a bit..
> What is the nature of the variable steps? Could they be handled by the
> 'return SKIPPED' mechanism?
They are determined at "runtime", so no the SKIPPED trick is not
possible. In one of my step subclasses I do processing of the log output
of the step and generate new steps in the commandComplete method.
[... stuff I already knew :-) ...]
> you'd need some sort of insert operation to make sure
> the BuildStatus had the correct sequence. In your later steps (or preferably
> in your Build subclass), when you decided you need to add some steps, you'd
> need to do something like:
>
> newstep = factory(build=self, **args)
> newstep.name = something_unique
> self.steps.insert(newstep, where)
> self.build_status.insertStep(newstep, where)
Which is close to what I already do, but in commandComplete. For context
here's what I do...
class Boost_Test(command_base):
def __init__(self, **kwargs):
[.. cut for brevity ..]
def commandComplete(self, cmd):
def test_match(t,r):
return t or r.match(parts[1])
#~ Get the log so we can parse it to find all the targets
#~ we can test.
out = cmd.log.getText()
[.. cut for brevity, stuff where I parse the log output ..]
#~ Construct new steps for each of the targets we want to test.
[.. cut for brevity ..]
count = 0
for test_target in test_targets:
kwargs['target'] = test_target
step = Boost_Jam(**kwargs)
count += 1
step.name = "%s.%d" % (step.name,count)
#~ The steps up to our point have been eaten away already.
#~ So we can add to the front so that the additional steps
#~ get executed before the rest.
self.build.steps.insert(count-1,step)
self.build.build_status.addStep(step)
[...]
> It might also make sense to replace addStep and
> insertStep with a single setSteps() method that just replaces the previous
> list of steps. However, you'd have to implement this in such a way that the
> status from already-started steps was not lost (maybe by walking the new list
> of steps and only creating new BuildStepStatus objects for the ones you
> haven't seen before).
>
> Dunno.. it sounds feasible, but a bit involved.
Hmm, I guess for now I could:
self.build.build_status.addStep(step)
steps = build_status.getSteps()
# rearrange steps to the correct order here
self.build.build_status.steps = steps
Or the equivalent.
Add this to my wish list for BuildStatus then:
def addStep(self, step, after=None, before=None):
Where after and before are step names.
> The other thing to pay attention to is the Progress tracking.
Since in Boost testing run times are measured in hours precision is not
really important. I'll worry about it when I have to :-)
> hope that helps,
Some, thanks.
--
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
More information about the devel
mailing list