【发布时间】:2014-04-02 21:34:53
【问题描述】:
在测试用例失败时,它会显示[ERROR] There are test failures.,但最后还会显示FINISHED:Build Success,在构建历史记录中显示为蓝色。
在失败和成功时,它还会使用我的 POM.xml 中的依赖项发送邮件,即
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>test</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>false</inherited>
<configuration>
<from>my email address</from>
<subject>Test Results</subject>
<failonerror>true</failonerror>
<mailhost></mailhost>
<receivers>
<receiver>recipientsemail</receiver>
</receivers>
<htmlMessageFile>
/workspace/target/surefire-reports/emailable-report.html
</htmlMessageFile>
</configuration>
</execution>
</executions>
</plugin>
这个插件在<build> 标签内。
我想发送成功和失败的电子邮件,但它也应该在 Jenkins 中失败。我想我需要改变一些东西Jenkins,因为我已经在 pom.xml 中指定了<failonerror>true</failonerror>。请让我知道我缺少什么。
我正在使用 Jenkins 1.466.2(Debian/Ubuntu 发行版)。
【问题讨论】: