[英]All maven surefire reports are zero! How could this happen?
I have a scala project configured with maven surefire plugin:我有一个配置了 maven surefire 插件的 scala 项目:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
When I run all the tests and generates the test report, I found the following information on the index page:当我运行所有测试并生成测试报告时,我在索引页面上发现了以下信息:
Surefire Report
Summary
[Summary] [Package List] [Test Cases]
Tests Errors Failures Skipped Success Rate Time
0 0 0 0 0% 0
It appears that all scalatest result under test-results/scalatest
are ignored?似乎忽略了
test-results/scalatest
下的所有 scalatest 结果? How could this happen.怎么会这样。 This will never happen to gradle test report.
gradle测试报告绝不会出现这种情况。
I just found out that scalatest was not designed to work with either maven-surefire-plugin or maven-surefire-report-plugin, it has to generate its own test report in html format:我刚刚发现 scalatest 不是为与 maven-surefire-plugin 或 maven-surefire-report-plugin 一起工作而设计的,它必须以 html 格式生成自己的测试报告:
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<reportsDirectory>${project.build.directory}/test-results/scalatest</reportsDirectory>
<junitxml>.</junitxml>
<htmlreporters>${project.build.directory}/site/scalatest</htmlreporters>
...
case closed.结案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.