From: Flavia R. <fla...@jb...> - 2010-11-30 16:34:25
|
Hi all, I'm new to this list and I'm a big fan of Cobertura. I'm sending this e-mail to talk about a problem I'm having. If I run mvn clean install cobertura:cobertura with this project: https://github.com/jbossas/jboss-msc, the results show 0% of coverage. The problem started when I changed the pom script: https://github.com/jbossas/jboss-msc/blob/master/pom.xml I needed to run one of the tests with a javaagent enabled, so I had to create two test executions: one that runs all the other tests, and a second one that runs the specific test with javaagent. Given that the test that requires javaagent will fail if it's executed without the agent, I added a skip true to the surefire-plugin parent configuration, and each surefire execution override this value with false. My previous pom, that contained the tags below, used to work ok with cobertura. So I'm assuming the cause of the problem is the skip true in the parent surefire tag. For some reason, cobertura fails to detect that there are surefire executions overriding skip value with false. Can somebody look into this? It would be great if this were fixed in a future release :-). <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>jboss.msc.profile.output</name> <value>${project.build.testOutputDirectory}/prof.txt</value> </property> <property> <name>java.util.logging.manager</name> <value>org.jboss.logmanager.LogManager</value> </property> </systemProperties> <includes> <include>**/*TestCase.java</include> </includes> <excludes> <exclude>org/jboss/msc/bench/*.java</exclude> <exclude>org/jboss/msc/racecondition/*.java</exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>run-racecondition-tests</id> <goals> <goal>run</goal> </goals> <phase>test</phase> <configuration> <target> <property name="byteman.path" value="${maven.dependency.org.jboss.byteman.byteman.jar.path}" /> <property name="report.dir" value="${project.build.directory}/surefire-reports" /> <property name="testOutputDirectory" value="${project.build.testOutputDirectory}" /> <property name ="jboss.msc.profile.output" value="${project.build.testOutputDirectory}/prof.txt" /> <property name="java.util.logging.manager" value="org.jboss.logmanager.LogManager" /> <property name="bytemanScript" value="${testOutputDirectory}/org/jboss/msc/racecondition/StopRequestedToUpTransitionTestCase.txt"/> <junit printsummary="yes" fork="true" haltonfailure="true" haltonerror="true"> <classpath><path refid="maven.test.classpath"/></classpath> <jvmarg value="-javaagent:${byteman.path}=script:${bytemanScript}"/> <sysproperty key="org.jboss.byteman.debug" value="true"/> <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" /> <formatter type="plain" usefile="true" extension=".txt" /> <test fork="yes" name="org.jboss.msc.racecondition.StopRequestedToUpTransitionTestCase" todir="${report.dir}"/> </junit> </target> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-junit</artifactId> <version>1.6.5</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> </dependency> </dependencies> </plugin> Regards, -- Flavia Rainone | JBoss Core Developer M: (+55) (+11) 8122-5466 YIM/MSNIM: flaviarnn |