Skip to content
Browse files

Add hooks for StepStatus.text and test2 to IStatusReceiver and test t…

…hat they're called (fixed #410)
  • Loading branch information...
1 parent a949400 commit 947a6a3ffb74a1df479fe7437fa06f252f1825c7 @Pike committed Dec 31, 2008
Showing with 31 additions and 2 deletions.
  1. +12 −0 buildbot/interfaces.py
  2. +6 −0 buildbot/status/base.py
  3. +4 −0 buildbot/status/builder.py
  4. +9 −2 buildbot/test/test_status.py
View
12 buildbot/interfaces.py
@@ -923,6 +923,18 @@ def stepStarted(build, step):
logStarted/logFinished messages, it will also receive stepETAUpdate
messages about every updateInterval seconds."""
+ def stepTextChanged(build, step, text):
+ """The text for a step has been updated.
+
+ This is called when calling setText() on the step status, and
+ hands in the text list."""
+
+ def stepText2Changed(build, step, text2):
+ """The text2 for a step has been updated.
+
+ This is called when calling setText2() on the step status, and
+ hands in text2 list."""
+
def stepETAUpdate(build, step, ETA, expectations):
"""This is a periodic update on the progress this Step has made
towards completion. It gets an ETA (in seconds from the present) of
View
6 buildbot/status/base.py
@@ -26,6 +26,12 @@ def buildETAUpdate(self, build, ETA):
def stepStarted(self, build, step):
pass
+ def stepTextChanged(self, build, step, text):
+ pass
+
+ def stepText2Changed(self, build, step, text2):
+ pass
+
def stepETAUpdate(self, build, step, ETA, expectations):
pass
View
4 buildbot/status/builder.py
@@ -862,8 +862,12 @@ def setColor(self, color):
self.color = color
def setText(self, text):
self.text = text
+ for w in self.watchers:
+ w.stepTextChanged(self.build, self, text)
def setText2(self, text):
self.text2 = text
+ for w in self.watchers:
+ w.stepText2Changed(self.build, self, text)
def setStatistic(self, name, value):
"""Set the given statistic. Usually called by subclasses.
View
11 buildbot/test/test_status.py
@@ -794,6 +794,10 @@ def stepStarted(self, build, step):
print "EXP", step.getExpectations()
if "step" in self.mode:
return self
+ def stepTextChanged(self, build, step, text):
+ self.events.append(("stepTextChanged", step, text))
+ def stepText2Changed(self, build, step, text2):
+ self.events.append(("stepText2Changed", step, text2))
def stepETAUpdate(self, build, step, ETA, expectations):
self.events.append(("stepETAUpdate", build, step, ETA, expectations))
self.announce()
@@ -903,9 +907,12 @@ def _testSlave_2(self, res):
"builderChangedState", # idle
"builderChangedState", # building
"buildStarted",
- "stepStarted", "stepETAUpdate", "stepFinished",
+ "stepStarted", "stepETAUpdate",
+ "stepTextChanged", "stepFinished",
"stepStarted", "stepETAUpdate",
- "logStarted", "logFinished", "stepFinished",
+ "stepTextChanged", "logStarted", "logFinished",
+ "stepTextChanged", "stepText2Changed",
+ "stepFinished",
"buildFinished",
"builderChangedState", # idle
])

0 comments on commit 947a6a3

Please sign in to comment.
Something went wrong with that request. Please try again.