add jenkins-mail-py to support mail test result

This commit is contained in:
debugtalk
2017-08-02 23:37:23 +08:00
parent 5291586053
commit a4bbdb4f81
5 changed files with 52 additions and 10 deletions

View File

@@ -28,6 +28,12 @@ def main():
'--failfast', action='store_true', default=False,
help="Stop the test run on the first error or failure.")
try:
from jenkins_mail_py import MailgunHelper
mailer = MailgunHelper(parser)
except ImportError:
mailer = None
args = parser.parse_args()
if args.version:
@@ -69,4 +75,7 @@ def main():
if len(result.successes) != result.testsRun:
flag = "FAILED"
if mailer and mailer.config_ready:
mailer.send_mail(flag, content=results)
return flag, results