RFC: JMC-5657: Code coverage with Jacoco

Guru guru.hb at oracle.com
Tue May 7 16:37:41 UTC 2019


Hi Carmine, 

Please check my comments inline.

Thanks,
Guru
> On 07-May-2019, at 2:05 PM, Carmine Vincenzo Russo <carusso at redhat.com> wrote:
> 
> Hello everyone,
> 
> This patch adds Jacoco coverage over unit test in JMC.
> The module covered in particular are: /core/tests and /application/tests.
> 
> The patch addresses the issue JMC-5657[0], but as noted by Klara Ward[1],
> instead of adding Jcov, it's better to add Jacoco.
> 
> For the time being, each test group had a new module, report, where an
> aggregate-report can be found.
> You need to run 'mvn verify' in jmc root for /application/tests and in
> /core for /core/tests to have the coverage report.
Logically there are three build step 
1. For releng 
2. Core modules 
3. Jmc product (i.e Application) 
Ideally `mvn verify` is run on ~/jmc/core (for step 2) and ~/jmc (for step 3). Unless there is restriction on defining Jacoco in root of ~/jmc/core/pom.xml and ~/jmc/pom.xml. 
> 
> There are also some aspects that concern me, so: Is this what we are
> looking for?
> The report for /core[2] looks good and clean. The report for
> /application/tests[3][4] has good results, although there are some 0%, and
> that is ok, but also some N/A. Should we keep the modules in the report
> with only N/A?
> 
> There are also some changes in /application/uitests when reading the patch,
> they are not yet applied but I would like to add them to the next patch.
Please file a follow on new JBS and link with old one (relates to JMC-5667). 
> This brings me to my second concern: should the tests and uitests in
> /application have a unique report or should I keep them separate?
Good to have Unique rather than separate. 
> 
> Lastly, do we want coverage with every verify build or do we want a maven
> profile/flag to have the coverage only in some occasions?
This could be based on how much time Jacoco Code coverage takes. If its negligible then good to have on every verify build or with a profile/flag. 
> 
> Overall, how does the patch look like? Do you think there are some more
> modules that need to be covered? And do you have any suggestions on how to
> improve what I've done?
If possible, please update the patch to ~/jmc/core/pom.xml and ~/jmc/pom.xml. 
> 
> Thanks,
> Carmine
> 
> [0] https://bugs.openjdk.java.net/browse/JMC-5657
> [1] http://mail.openjdk.java.net/pipermail/jmc-dev/2019-March/000882.html
> [2] https://imgur.com/hPyyLsQ
> [3] https://imgur.com/fqdzGvH
> [4] https://imgur.com/ozqNcAB
> 
> -- 
> Carmine Vincenzo Russo
> <5657-0.patch>



More information about the jmc-dev mailing list