This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 214946 - JaCoCo code coverage metrics not collected in all cases
Summary: JaCoCo code coverage metrics not collected in all cases
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: Codecoverage (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Assignee: Martin Schovanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-28 20:32 UTC by everflux
Modified: 2012-07-01 16:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sluggishness in RC1 (36.64 KB, application/octet-stream)
2012-06-29 20:57 UTC, everflux
Details
self profiling of 20 seconds showing 13,3 seconds spent in reference handler (68.41 KB, image/png)
2012-06-29 20:59 UTC, everflux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description everflux 2012-06-28 20:32:06 UTC
[ BUILD # : 201206280002 ]
[ JDK VERSION : 1.7.5 ]

I have a maven project with JaCoCo configured
<!-- code coverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.5.7.201204190339</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

and selected the "Code coverage->Collect and Display Code Coverage" setting in
the  project context menu.
When running all tests for the project by right clicking on the project and
selecting "Test" all tests are run with maven and the agent is active:


[jacoco:prepare-agent]
argLine set to
-javaagent:/home/tkruse/.m2/repository/org/jacoco/org.jacoco.agent/0.5.7.2012041
90339/org.jacoco.agent-0.5.7.201204190339-runtime.jar=destfile=...........target
/jacoco.exec

The repot shows "No data -- have you run your code yet?"

Only when I click on the report to "Run All Tests" the report gets filled with
data.

When having a java file open for which an accompanying test exists, the "Test"
button does not fill in coverage data neither, the "All Tests" button works,
though. It is a little inconvenient to always run all tests to check for the
coverage change of a single file.
Comment 1 Milos Kleint 2012-06-29 12:20:19 UTC
most probably an issue with the code coverage modules. partly duplicate of issue 214236.
jacoco should work better than cobertura in the sense that it doesn't need extra compilation, just injects the agent.
Comment 2 everflux 2012-06-29 20:57:31 UTC
Created attachment 121581 [details]
Sluggishness in RC1
Comment 3 everflux 2012-06-29 20:59:16 UTC
Created attachment 121582 [details]
self profiling of 20 seconds showing 13,3 seconds spent in reference handler
Comment 4 everflux 2012-06-29 21:03:19 UTC
Comment on attachment 121581 [details]
Sluggishness in RC1

sorry attached to wrong bug - please remove the attachment
Comment 5 everflux 2012-07-01 16:39:41 UTC
BUILD # : 201206272359

Coverage data is not collected from regular "test" runs (single test case or whole project, just when "Run All Tests" on the code coverage report view the data is shown.