You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by globulon <gl...@gmail.com> on 2008/01/10 13:26:35 UTC

Cobertura plugin

Houdy,

I am newby to Maven 2.

I have Introduced the Cobertura plugin in the reporting section of the
pom.xml file of my main project as follows:

<reporting>
...
		<plugins>

			<!--
                               - JUNIT test report activation
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
			</plugin>
			<!--
                               - Cobertura Code coverage module
                       -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<configuration>
					<formats>
						<format>html</format>
					</formats>
				   <instrumentation/>
				   <check>
						   <!-- should not stop in case of Cobertura reporting error -->
						   <haltOnFailure>false</haltOnFailure>
				   </check>
				</configuration>
			</plugin>
            </plugins>
...
</reporting>

It works fine. As I am also using the surefire reporting, it seems the test
phase is run twice, one by
surefire and once by cobertura.

Is there any way to instrument code before surefire execution for the two
plugin to share the same test sequence ?

Thanx for your response ?
-- 
View this message in context: http://www.nabble.com/Cobertura-plugin-tp14731193s177p14731193.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Cobertura plugin

Posted by Stephen Connolly <st...@gmail.com>.
Danger! Will Robinson! Danger!

How will you know that instrumenting your tests is not causing them to pass?

Seriously, we had hand tweaked the pom to run the tests only once when they
were instrumented, and as the instrumentation was forcing synchronisation
(in order to track code path execution) it was eliminating a major
concurrency bug that our unit tests were trying to prove was not there...

IMHO, you _want_ to run the tests twice.

-Stephen

On Jan 10, 2008 12:26 PM, globulon <gl...@gmail.com> wrote:

>
> Houdy,
>
> I am newby to Maven 2.
>
> I have Introduced the Cobertura plugin in the reporting section of the
> pom.xml file of my main project as follows:
>
> <reporting>
> ...
>                <plugins>
>
>                        <!--
>                               - JUNIT test report activation
>                        -->
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-surefire-report-plugin</artifactId>
>                        </plugin>
>                        <!--
>                               - Cobertura Code coverage module
>                       -->
>                        <plugin>
>                                <groupId>org.codehaus.mojo</groupId>
>
>  <artifactId>cobertura-maven-plugin</artifactId>
>                                <configuration>
>                                        <formats>
>                                                <format>html</format>
>                                        </formats>
>                                   <instrumentation/>
>                                   <check>
>                                                   <!-- should not stop in
> case of Cobertura reporting error -->
>
> <haltOnFailure>false</haltOnFailure>
>                                   </check>
>                                </configuration>
>                        </plugin>
>            </plugins>
> ...
> </reporting>
>
> It works fine. As I am also using the surefire reporting, it seems the
> test
> phase is run twice, one by
> surefire and once by cobertura.
>
> Is there any way to instrument code before surefire execution for the two
> plugin to share the same test sequence ?
>
> Thanx for your response ?
> --
> View this message in context:
> http://www.nabble.com/Cobertura-plugin-tp14731193s177p14731193.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>