How to calculate code coverage in Hudson using emma for a multi-module maven project but only run tests once

倖福魔咒の 提交于 2019-12-23 03:19:42

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3459988/how-to-calculate-code-coverage-in-hudson-using-emma-for-a-multi-module-maven-pro

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!