aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/python2.7/site-packages/autobuilder/YoctoMailer.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/YoctoMailer.py b/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
index 1e435a0b..19e75e41 100644
--- a/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
+++ b/lib/python2.7/site-packages/autobuilder/YoctoMailer.py
@@ -65,10 +65,8 @@ class YoctoMailNotifier(MailNotifier):
def isMailNeeded(self, build, results):
# here is where we actually do something.
builder = build.getBuilder()
- repo=build.getProperty("repository")
- branch=build.getProperty("branch")
- log.msg(repo)
- log.msg(branch)
+ repo = build.getProperty("repository")
+ branch = build.getProperty("branch")
buildme = False
if self.builders is not None and builder.name not in self.builders:
return False # ignore this build
@@ -107,3 +105,27 @@ class YoctoMailNotifier(MailNotifier):
if "exception" in self.mode and results == EXCEPTION:
return True
return False
+
+ # FIXME: currently we'll report failed build steps AND the build they cause
+ # to fail, it should be one or the other.
+ # TODO: should choosing steps vs. builds be a user-configurable option?
+ def stepFinished(self, build, step, results):
+ """
+ The buildstep 'step' of 'build' just finished 'results' is one of the
+ constants in buildbot.status.builder: SUCCESS, WARNINGS, FAILURE,
+ SKIPPED or EXCEPTION.
+
+ @type build: buildbot.status.build.BuildStatus
+ @type step: buildbot.status.build.BuildStepStatus
+ @type results: constant
+ """
+ if ( not self.buildSetSummary and
+ self.isMailNeeded(build, results) ):
+ # for testing purposes, buildMessage returns a Deferred that fires
+ # when the mail has been sent. To help unit tests, we return that
+ # Deferred here even though the normal IStatusReceiver.buildFinished
+ # signature doesn't do anything with it. If that changes (if
+ # .buildFinished's return value becomes significant), we need to
+ # rearrange this.
+ return self.buildMessage(name, [build], results)
+ return None