简体   繁体   English

Jenkins电子邮件通知因编译错误而导致构建失败

[英]Jenkins email notification for build failure due to compile error

I have continuous integration setup using jenkins and also integrated selenium scripts for nightly build. 我使用jenkins进行了持续集成设置,并且还集成了Selenium脚本以进行每晚构建。 I also have editable email notification for sending emails in case of any build failure. 我还具有可编辑的电子邮件通知,用于在任何构建失败的情况下发送电子邮件。

The default content for editable email notification is 可编辑电子邮件通知的默认内容是

$DEFAULT_CONTENT $ DEFAULT_CONTENT

${JELLY_SCRIPT,template="text"} $ {JELLY_SCRIPT,template =“ text”}

${FAILED_TESTS} $ {FAILED_TESTS}

This content give me clear picture if there is any fail in the selenium script with full stacktrace. 如果在具有完整堆栈跟踪的Selenium脚本中有任何失败,此内容将为我提供清晰的画面。

The problem is that, if the jenkins build got failed due to compile error or any other failure reasons, the email notification is not providing any reason about the failure. 问题是,如果jenkins构建由于编译错误或任何其他失败原因而失败,则电子邮件通知不提供有关失败的任何原因。 It simply says No tests ran. 它只是说没有测试运行。

How to make jenkins to send mail notification with the failure reason, if the build got failed due to compile time error ? 如果构建由于编译时错误而失败,如何使jenkins发送失败原因的邮件通知?

You can attach build logs and any reports that your selenium has producing with the editable email notification. 您可以将构建日志和硒生成的任何报告附加到可编辑的电子邮件通知中。

Below is a screenshot of what you can do: 以下是您可以做什么的屏幕截图: 在此处输入图片说明

Attached Logs can give you Info on build failure and other details And reports can be customized as you need. 随附的日志可以为您提供有关build failure和其他详细信息的信息,并且可以customized需要customized报告。
More links: 更多链接:

You can create two jobs , one is for triggering build for every check and one for running automation suite. 您可以创建两个作业,一个作业用于触发每次检查的构建,另一个作业用于运行自动化套件。

It may resolve your problem 它可以解决您的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM