如何使用 emma 计算 Hudson 中多模块 Maven 项目的代码覆盖率,但只运行一次测试
我们有几个多模块项目,我想对其运行 emma,但我不希望测试运行两次,因为这会导致 Hudson 项目主页上的统计数据产生误导,因为单元测试被计算两次。
对于单个模块项目,我们可以省略安装目标,只使用 clean emma:emma 运行一次测试,有什么方法我们可以只使用 emma 检测的字节代码进行测试,然后构建和构建?安装项目工件而不再次运行测试?使用 -Dmaven.tests.skip=true 会导致 emma 失败。
对于完整版本(即 mvn release:perform),测试应该在未检测的情况下运行。
We have several multi-module projects which I want to run emma against, but I don't want the tests to be run twice, because this results in misleading statistics on the Hudson project home page as unit tests are counted twice.
For a single module project, we can ommit the install goal and just use clean emma:emma to run the tests once, is there any way we can test only using emma instrumented byte code and then build & install the project artifacts without running the tests a second time? Using -Dmaven.tests.skip=true causes emma to fail.
For a full release (i.e. mvn release:perform) the tests should be run un-instrumented.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以考虑以下文章来回答“如何计算..”代码覆盖率。这样,哈德逊的覆盖范围将不可见,但声纳却可见。这并不完全是您正在寻找的,但是 sonar 值得评估。 (安装真的很容易)
我将使用配置文件来激活 emma 的测试配置,默认情况下,项目是在不运行测试的情况下构建和安装的。
You may consider the following article to answer "how to calculate.." code coverage. The coverage would then not be visible in Hudson but in sonar. This is not exactly what you are looking for, but sonar is worth an evaluation. (Installation is really a breeze)
I would use a profile to activate the test configuration with emma, and that by default the project is built and installed without running tests.