Hi,
the reason for the big exec file is the org.sonar.java.JUnitListener you
configured. It dumps all execution data after every single test case.
This allows Sonar to createeorg.sonar.java.jacoco.JUnitListener a "per
test" coverage report.
If you just want to see the overall code coverage just remove the Sonar
JUnitListener -- it is not required. If you're looking for a "per test"
coverage report please report the OOM to SonarQube.
Best regards,
-marc
On 11.06.14 00:38, [email protected] wrote:
Hello,
I am generating a .exec file using the maven plugin. The .exec file that is
being generated is around 1gig. This seems excessive for the project the file
is generated for. The project is 1472 files, 2107 classes and 92,000 lines of
code. I wouldn't be overly concerned about the exec file size, except it
results in Sonar chucking OOM exceptions trying to analyze the exec file.
I am using Java 7, JaCoCo - 0.7.1.201405082137, Surefire - 2.17 . I have read
that large exec files can be produced if unit tests are being run in forked
JVMs for each test. I am not forking multiple unique test JVMs. When I look at
the generated coverage reports (HTML), there are sessions listed for each test
case and a bunch of sessions with no session id. I would think that there
should only be a single session for a test run?
Here is the surefire config
<plugin>
<!-- Used to fire of Junits -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.17</version>
</dependency>
</dependencies>
<configuration>
<argLine>-Xmx512m -XX:MaxPermSize=256m
${jacoco.agent.ut.arg}</argLine>
<properties>
<property>
<name>listener</name>
<value>org.sonar.java.jacoco.JUnitListener</value>
</property>
</properties>
</configuration>
</plugin>
Here is the jacoco config
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<!-- Prepares a variable, jacoco.agent.ut.arg,
that contains the info to be passed to the JVM hosting the code
being tested. -->
<execution>
<id>prepare-ut-agent</id>
<phase>process-test-classes</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<propertyName>jacoco.agent.ut.arg</propertyName>
<append>true</append>
<skip>${sonar.jacoco.skip}</skip>
<includes>
<include>com.denmartech.*</include>
</includes>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<configuration>
<dataFile>${sonar.jacoco.reportPath}</dataFile>
<outputDirectory>${project.build.directory}/coverage-reports</outputDirectory>
</configuration>
</plugin>
I can generate a coverage report from the large .exec. But, the file is just
too big for Sonar. I have monkeyed with the JVM params to increase available
memory for Sonar, I have not found the right level of memory yet. I am thinking
though that I am treating the symptom and not the underlying problem.
Any suggestions would be appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups "JaCoCo
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.