简体   繁体   English

在Sonar中,如何通过测试查看测试覆盖率?

[英]In Sonar, how do I view test coverage by tests?

I know I can drill down in the coverage widget on the dashboard and see the code and branch coverage. 我知道我可以在仪表板上的coverage小部件中深入查看代码和分支覆盖范围。 However, I would like to see what source files and lines of code are covered by each individual test. 但是,我想看看每个测试都涵盖了哪些源文件和代码行。 It's looking like Sonar doesn't support this the other way around. 看起来Sonar并不支持这种方式。 If it's not supported, is there a way I can configure Sonar to do such? 如果它不受支持,有没有办法可以配置Sonar这样做? FYI, we are using JaCoCo for test coverage right now. 仅供参考,我们现在正在使用JaCoCo进行测试覆盖。 Any info greatly appreciated! 任何信息非常感谢!

This probably doesn't help much, but I'm pretty sure that this is not supported. 这可能没有多大帮助,但我很确定这不受支持。

Sonar will only allow you to view the results by tested class, not by test class. Sonar只允许您通过测试类来查看结果,而不是通过测试类。

One way to work around this would be to run Sonar multiple times, once for each test class, but that's probably not easy to do and probably not what you're looking for. 解决这个问题的一种方法是多次运行Sonar,每个测试类一次,但这可能并不容易,可能不是你想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM