【发布时间】:2018-12-12 00:55:58
【问题描述】:
我是 surefire 插件的新手,正在尝试设置以重新运行易碎测试。
我的配置如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M2</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<rerunFailingTestsCount>1</rerunFailingTestsCount>
</configuration>
</plugin>
而我使用的命令是:
mvn clean test -DsuiteXmlFile=testNG.xml -Dsurefire.rerunFailingTestsCount=2
我明白了:
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.12 s <<< FAILURE! - in TestSuite
[ERROR] ieTest1(com.mycompany.testcases.Sample.independentTest) Time elapsed: 3.839 s <<< FAILURE!
java.lang.AssertionError: expected [true] but found [false]
但是我可以看到 /target/surefire-reports 已生成,但没有重新运行。任何人都可以帮助弄清楚为什么重播没有触发?
【问题讨论】:
-
如果您的测试真的很不稳定,可以修复它们...这是唯一的解决方案...不要重复它们...
-
我不拥有这些测试。我来自支持自动化运行的基础架构团队。
-
你应该联系开发人员并让他们修复他们......
-
检查
target/surefire-reports有输出吗? -
是的,我收到了可靠的报告。
标签: maven testng maven-surefire-plugin