Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340618

Summary: Optimize Coverage report generation
Product: [Eclipse Project] Platform Reporter: Brock Janiczak <brockj>
Component: RelengAssignee: Kim Moir <kim.moir>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: hoffmann, kim.moir, Olivier_Thomann
Version: 4.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch none

Description Brock Janiczak CLA 2011-03-21 22:11:16 EDT
Build Identifier: 

As mentioned in this page:
http://relengofthenerds.blogspot.com/2011/03/sdk-code-coverage-with-jacoco.html
The coverage reports that are generated for the build are quite large.

There is a point release of jacoco (http://sourceforge.net/projects/eclemma/files/07_JaCoCo/trunk/jacoco-0.5.1.20110321224001.zip/download) will help reduce this a bit, but there might be other things that can be done to reduce the report size.

1. Do not merge exec files before reporting.  Only use the exec files that relate to the plugins being reported on.  This will reduce the size of the .session.html files
2. supply the includes option to the coverage agent during test execution.  This should usually be <bundle name>.* but may not work for all plugins.  This should dramatically reduce the size of the .session.html files
3. supply the sessionid parameter to the coverage agent during test execution.  This should be the name of the test suite being executed.  This should give users a better idea of what tests were run to get the coverage data.

Reproducible: Always
Comment 1 Olivier Thomann CLA 2011-03-22 11:40:00 EDT
Is it possible to generate multiple runs into one single exec file ?
Like create it the first time and append to it for the next run ?

Thanks.

We cannot simply use a new drop of Jacoco as it needs to go through IP review first. And this is too late for Indigo now. So we need to live with the actual version for now at least.
Comment 2 Kim Moir CLA 2011-03-22 11:47:10 EDT
What is your timeframe for your next major release? The reason I'm asking is that we have to get the Eclipse Foundation's legal approval for the inclusion of any new third party binaries.  The deadlines for Indigo approvals has passed, so we would have to defer using a new JaCoCo binaries until Juno, which starts development in June.  

I'll try using the unmerged bundles for the reports as well as your other two suggestions. Olivier, is there a reason that the exec files have timestamps in them or was this just to measure how long they took to produce? 

${coverage-output}/jacoco${classname}${NOW.DSTAMP}_${NOW.TSTAMP}.exec

Note: http://www.eclemma.org/jacoco/trunk/doc/agent.html for agent options
Comment 3 Brock Janiczak CLA 2011-03-22 16:59:14 EDT
(In reply to comment #1)
> Is it possible to generate multiple runs into one single exec file ?
> Like create it the first time and append to it for the next run ?

Sure can, just add append=true to the agent options.  You could also merge teh two exec files, but appending is simpler
Comment 4 Marc R. Hoffmann CLA 2011-03-23 01:58:39 EDT
There is another functional aspect behind not merging the coverage files or applying the includes filter: This will avoid that bundles contribute to each others code coverage (due to dependencies) which will give a better picture of the actual unit test coverage. Using the includes filter will then also allow to create a combined report for all bundles (allowing to compare the bundles e.g. regarding their size and code coverage).

BTW, 0.5.1 produces valid stackmap frames again for Java >=1.6.
Comment 5 Kim Moir CLA 2011-03-25 16:10:56 EDT
Created attachment 191935 [details]
patch
Comment 6 Kim Moir CLA 2011-08-26 13:49:29 EDT
Any plans to get the latest release of Jacoco into Orbit for Juno?
Comment 7 Marc R. Hoffmann CLA 2011-08-26 17:34:52 EDT
We're now on 0.5.3 with several updates. JaCoCo now also calculates cyclomatic complexity, which is a good indicator for the number of unit tests missing:

  http://www.eclemma.org/jacoco/trunk/doc/changes.html

In case this helps with the Orbit process, JaCoCo is now also available via the Maven repository:

  http://www.eclemma.org/jacoco/trunk/doc/repo.html
Comment 8 Kim Moir CLA 2012-03-23 14:43:21 EDT
Jacoco has been removed from the build due to lack of resources.  See bug 373594