[
http://jira.codehaus.org/browse/MCOBERTURA-86?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stevo Slavic updated MCOBERTURA-86:
-----------------------------------
Attachment: cobertura-maven-plugin_check-only-mojo.patch
Wish "report-only" mojo was included in 2.3, hopefully it will get included in
2.4, together with this new one, "check-only" mojo (see attached
cobertura-maven-plugin_check-only-mojo.patch). Current cobertura:check mojo is
heavy, it includes running tests, so if one wants to run tests (e.g. with
surefire), auto check coverage (cobertura:check), and get a coverage report in
a site (using cobertura:cobertura), tests get run at least 3 times - having
tests run twice (once on non instrumented code to check if code is ok, and once
on instrumented code to get coverage) takes time but it's understandable, while
having them run 3 times is way too much. Point is that cobertura maven plugin
should be able to reuse coverage data for both check and for report generation
tasks. With report-only and check-only this is feasible - with all these mojos
at hand one could:
1) cobertura:clean
2) run the tests on non instrumented code and only if they pass execute...
3) cobertura:instrument
4) run the tests on instrumented code (this would generate coverage data)
5) cobertura:check-only, to check if coverage requirements are met, and only if
they are execute...
6) cobertura:report-only, as part of project site generation
> no coverage reported for integration-test
> -----------------------------------------
>
> Key: MCOBERTURA-86
> URL: http://jira.codehaus.org/browse/MCOBERTURA-86
> Project: Maven 2.x Cobertura Plugin
> Issue Type: Bug
> Affects Versions: 2.2
> Environment: Windows XP, maven 2.0.8
> Reporter: Jean-Francois Poilpret
> Attachments: cobertura-maven-plugin_check-only-mojo.patch,
> CoberturaIntegrationReportMojo.patch, CoberturaReportOnlyMojo.patch
>
>
> In my project, I have both unit tests ("test" phase) and integration tests
> ("integration-test" phase).
> So far I could manage configuring maven-surefire-plugin and
> maven-surefire-report-plugin to execute both tests correctly and also
> generate 2 different reports.
> Then I have added cobertura-maven-plugin to the reporting in order to get
> coverage but unfortunately only unit tests have their coverage reported (I
> know it because I have some classes which are only integration tested but are
> reported as 0% covered).
> After trying to find information on the mailing lists, on the web and other
> existing resources, I could not find any hint on how to make this work.
> It looks like cobertura-maven-plugin, by its current design, will never run
> integration-test to collect coverage, it seems to stop at the "test" phase.
> Thus whenever a POM project has integration tests and uses
> cobertura-maven-plugin for coverage report, the generated reports are wrong,
> which is very misleading.
> Actually, I was surprised not to find this issue already in JIRA.
> Is there a chance this gets fixed soon? Or is there a usable workaround for
> this problem (besides switching to clover which I am not sure it would work
> better ;-)) Did someone succeed in patching cobertura-maven-plugin to get the
> correct behavior?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email