Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: scripts/master/exception_notifier.py

Issue 720273003: ExceptionNotifier: a new MailNotifier which treats exceptions as failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Addressed comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/master/unittests/exception_notifier_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/exception_notifier.py
diff --git a/scripts/master/exception_notifier.py b/scripts/master/exception_notifier.py
new file mode 100644
index 0000000000000000000000000000000000000000..f4eab34c9e115c3c861ddefb570e61e04282c564
--- /dev/null
+++ b/scripts/master/exception_notifier.py
@@ -0,0 +1,20 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""A fixed version of MailNotifier which treats exception as failure."""
+
+from buildbot.status import mail
+from buildbot.status.results import FAILURE, EXCEPTION
+
+class ExceptionNotifier(mail.MailNotifier):
+ """Same as MailNotifier that treats EXCEPTION as failure."""
+ def isMailNeeded(self, build, results):
+ builder = build.getBuilder()
+ if self.builders is not None and builder.name not in self.builders:
+ return False
+ if self.categories is not None and builder.category not in self.categories:
+ return False
+ if self.mode == 'failing' and results in [FAILURE, EXCEPTION]:
+ return True
+ return mail.MailNotifier.isMailNeeded(self, build, results)
« no previous file with comments | « no previous file | scripts/master/unittests/exception_notifier_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698