声纳使用mvn sonar:sonar将cobertura.ser覆盖率报告导入声纳服务器 [英] SONAR importing cobertura.ser coverage reports to sonar server using mvn sonar:sonar?

查看:106
本文介绍了声纳使用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 docs):

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:

  • http://docs.codehaus.org/display/SONAR/Advanced+Parameters
  • http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Unit+Tests
  • http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests

Sonarsource教程正越来越多地推动JaCoCo.这似乎是一个新兴的标准(取代了早已不存在的Emma项目)

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

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

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