mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-14 16:37:34 +08:00
add jenkins-mail-py to support mail test result
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user