【发布时间】:2019-10-16 04:14:41
【问题描述】:
我正在使用 Jenkins 运行我的测试项目。我可以在 Jenkins 中看到 Junit 报告,但现在我想在每次完成运行后复制 Jenkins 电子邮件中的 Junit 结果表。
我希望Junit报告表可以出现在Jenkins自动发送的电子邮件中。因此,无论谁收到电子邮件,他们都可以知道项目的状态。
【问题讨论】:
标签: email jenkins testing junit report
我正在使用 Jenkins 运行我的测试项目。我可以在 Jenkins 中看到 Junit 报告,但现在我想在每次完成运行后复制 Jenkins 电子邮件中的 Junit 结果表。
我希望Junit报告表可以出现在Jenkins自动发送的电子邮件中。因此,无论谁收到电子邮件,他们都可以知道项目的状态。
【问题讨论】:
标签: email jenkins testing junit report
如果您使用 JenkinsFile 使用 Jenkins 管道,则可以如下所示完成。 通常,所有单元测试用例报告都在目标文件夹的故障安全报告中生成。所以试着给出正确的模式来找出文件。
def call() {
def junitPattern = '**/failsafe-reports/*.xml';
def subject =" write your subject" ;
String emailTo = "xxx" ;
def body = " write your mail body"
def providers = [[$class: 'CulpritsRecipientProvider'], [$class: DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']]
emailext to: emailTo, recipientProviders: providers, compressLog: true, subject: subject, attachmentsPattern: junitPattern , body: body
}
【讨论】: