[Buildbot-commits] [SPAM] [Buildbot] #837: When doStepIf skips a step, finished() is called without start()

Buildbot buildbot-devel at lists.sourceforge.net
Thu May 13 18:05:21 UTC 2010


#837: When doStepIf skips a step, finished() is called without start()
----------------------+-----------------------------------------------------
Reporter:  gward      |       Owner:       
    Type:  undecided  |      Status:  new  
Priority:  major      |   Milestone:  0.8.1
 Version:  0.7.11     |    Keywords:       
----------------------+-----------------------------------------------------
 I have a custom build step that looks something like this:

 {{{
 class MyStep(ShellCommand):
     def start(self):
         ShellCommand.start(self)
         self.__privatedata = ...

     def finished(self, results):
         self.__privatedata.something()
         ...
 }}}

 This worked fine under 0.7.9 for a year or so.  In particular, it was safe
 for `finished()` to assume that `self.__privatedata` was set, because
 `start()` was always called.  But I recently had to upgrade to use
 `doStepIf`.  (Nice feature: thanks to whoever implemented it!)

 Now the assumption behind my `finished()` is no longer correct.  If a step
 is skipped because `doStepIf` returns false, `start()` is never called,
 but `finished()` is.  So my step fails with `AttributeError`.

 I've worked around it with try/except, but this seems bogus.  It would be
 nice if we could go back to guaranteeing that `start()` is called, but I
 can see how that might be difficult.  I would be perfectly happy to have a
 method in !BuildStep that *is* guaranteed to be called before the step
 runs, regardless of whether `start()` is called.  Then I can add private
 data attributes safely.

 (I'm pretty sure that I cannot do this in `__init__()` because of the
 weird, semi-magical nature of !BuildStep.)

-- 
Ticket URL: <http://buildbot.net/trac/ticket/837>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list