所有Maven Surefire报告均为零!这怎么会发生?

发布于 2025-01-26 16:36:24 字数 615 浏览 2 评论 0原文

我有一个配置了Maven surefire插件的Scala项目:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>

当我运行所有测试并生成测试报告时,我在索引页面上找到了以下信息:

Surefire Report
Summary

[Summary] [Package List] [Test Cases]

Tests   Errors  Failures    Skipped     Success Rate    Time
0   0   0   0   0%  0

看来,所有ScalAtest在test> test-> test-results/scaleatest下被忽略!这怎么会发生? Gradle测试报告将永远不会发生。

I have a scala project configured with maven surefire plugin:

      <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! How could this happen? This will never happen to gradle test report.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝梦月影 2025-02-02 16:36:24

我刚刚发现,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>

...

案例关闭。

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:

      <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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文