简体   繁体   English

所有 maven 万无一失的报告都是零? 怎么会这样?

[英]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.

相关问题 Maven 构建因测试失败而失败,但所有万无一失的报告都可以 - Maven build fails with test failures, but all surefire reports are ok 如何通过Google Cloud Build保存Maven Surefire报告 - How to save Maven Surefire reports through Google Cloud Build Maven保证。 将时间戳添加到带有报告的文件夹 - Maven surefire. Adding timestamp to folder with reports 如何让Maven Surefire运行所有类和测试? - How do I get Maven Surefire to run all classes and tests? Maven故障安全-Dtest报告已写入surefire = reports文件夹 - maven failsafe -Dtest reports written to surefire=reports folder 如何从 maven surefire 插件并行生成的几个报告中创建组合的黄瓜插件报告? - How create combined cucumber plugin report from several reports produced in parallel by maven surefire plugin? Maven surefire 找不到 ForkedBooter 类 - Maven surefire could not find ForkedBooter class 如何使 maven-surefire-plugin 重用创建的线程来执行所有 Maven 模块中的所有测试 - How to make maven-surefire-plugin reuse created thread to execute all tests in all Maven modules 如何将 maven 肯定转换为 gradle? - How to convert maven surefire into gradle? Maven surefire 插件报告 - 文件名太长 - Maven surefire plugin Reports - File name too long
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM