配置Sonar以查看集成测试(v6.2) [英] Configure Sonar to see Integration Tests (v6.2)

查看:72
本文介绍了配置Sonar以查看集成测试(v6.2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Sonar中可视化集成测试?

目前我只看到:

  • 全球范围(UT + IT)
  • UT的数量

我读到某个地方,我们必须在GUI中配置一个小部件:我看不到任何可以做到这一点的选项.

I read somewhere we had to configure a widget in the GUI : I didn't see any option which could do that.

文档状态:

如果未使用JaCoCo计算单元测试的覆盖率,则总体 覆盖率=集成测试覆盖率.

If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage.

但是对于我来说,当我更改UT(或IT)时,覆盖范围正在改变.此外,我在目标中看到了jacoco的报告:

But in my case I see that the coverage is changing when I change my UTs (or ITs). Moreover I see jacoco reports in the targets :

  • jacoco.exec
  • jacoco-it.exec

我最终尝试了Sonar的官方样品:是一样的!我没有发现任何样品之间有明显的分隔:

I finaly tryed the official Sonar samples : it is the same ! I didn't find any sample with a clear separation between :

  • 单元测试范围
  • 集成测试范围
  • 总体测试范围

对不起,但Sonar文档和示例必须改进...

And sorry but Sonar documentation and samples have to be improved...

上下文::sonar6.2,java8,spring boot,模块化项目,maven,surefire和故障安全

Context : sonar6.2, java8, spring boot, modular project, maven, surefire & failsafe

推荐答案

从SonarQube 6.2开始,所有测试结果都合并为简单的"coverage".这样做是基于这样的理论,即大多数人并不关心代码的覆盖范围,而只关心代码的覆盖范围.

Starting in SonarQube 6.2, all test results are merged into simply "coverage". This was done on the theory that by and large, most people don't care how their code is covered, only that it is covered.

通过此更改,消除了一些数学上的不一致之处,包括从单元测试和集成测试计算总覆盖率的方法,并且添加了提供许多不同覆盖率报告的功能. (有些人有单元,集成,冒烟,...测试).

With this change, some math inconsistencies w/r/t how Overall Coverage was calculated from unit tests versus integration tests were eliminated, and additionally the ability to feed many different coverage reports was added. (Some people have unit, integration, smoke, ... tests).

关于

我读到某个地方,我们必须在GUI中配置一个小部件:我看不到任何可以做到这一点的选项.

I read somewhere we had to configure a widget in the GUI : I didn't see any option which could do that.

在6.2中删除了仪表板,因此没有要配置的小部件.覆盖范围会自动显示在项目主页上.

In 6.2 dashboards were dropped, so there are no widgets to be configured. Coverage is shown automatically on the project home page.

这篇关于配置Sonar以查看集成测试(v6.2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆