当前位置: 动力学知识库 > 问答 > 编程问答 >

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

问题描述:

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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: