本文介绍了SONAR 使用 mvn sonar:sonar 将 cobertura.ser 覆盖率报告导入声纳服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 cobertura.ser 文件,它是在集成测试和系统测试时生成的.现在我想将我的覆盖范围导入到声纳服务器.

I have a cobertura.ser file, that got generated while integration-test and system test. Now I want to import my coverage this to sonar server.

我怎样才能做到这一点,所以在执行 mvn sonar:sonar 时,覆盖范围应该考虑外部 coberture.ser 文件?

How can I achieve this, so while executing mvn sonar:sonar the coverage should consider external coberture.ser file?

我可以使用声纳来做到这一点,我可以在哪里看到在所有测试运行期间获得的整体覆盖率?

Can I do this using sonar, where i can see overall coverage obtain during all test run?

推荐答案

您需要设置以下参数来告诉 Sonar 使用预先生成的报告:

You need to set the following paramater to tell Sonar to use a pre-generated report:

sonar.dynamicAnalysis=reuseReports

其次,Sonar 不读取cobertura.ser"文件.它可以配置如下来读取生成的 XML 报告(参见 cobertura 文档):

Secondly Sonar doesn't read the "cobertura.ser" file. It can be configured as follows to read the generated XML report (See cobertura docs):

sonar.cobertura.reportPath=target/reports/coverage.xml

最后,我对所有这些东西的参考来自 Sonar wiki:

Finally, my reference for all this stuff comes from the from the Sonar wiki:

Sonarsource 教程越来越多地推动 JaCoCo.这似乎是一个新兴标准(取代旧的已解散的 Emma 项目)

The Sonarsource tutorials are increasingly pushing JaCoCo. This appears to be an emerging standard (replacing the older defunct Emma project)

这篇关于SONAR 使用 mvn sonar:sonar 将 cobertura.ser 覆盖率报告导入声纳服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 11:11
查看更多