You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/04/01 21:29:22 UTC

[fineract] branch develop updated: Add Jacoco to measure code coverage (FINERACT-725 / PR #742)

This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 402c41d  Add Jacoco to measure code coverage (FINERACT-725 / PR #742)
402c41d is described below

commit 402c41dd9520d5931336e2babf91098baa668d30
Author: Manthan Surkar <42...@users.noreply.github.com>
AuthorDate: Thu Apr 2 02:59:15 2020 +0530

    Add Jacoco to measure code coverage (FINERACT-725 / PR #742)
    
    
    
    * Added Code Coverage Section in Readme
---
 README.md                      |  8 ++++++++
 fineract-provider/build.gradle | 15 +++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/README.md b/README.md
index e0887ee..6e77bfc 100644
--- a/README.md
+++ b/README.md
@@ -115,6 +115,14 @@ We recommend that you configure your favourite Java IDE to match those conventio
 File > Import > General > Preferences our [config/fineractdev-eclipse-preferences.epf](config/fineractdev-eclipse-preferences.epf).
 You could also use Checkstyle directly in your IDE (but you don't neccesarily have to, it may just be more convenient for you).  For Eclipse, use https://checkstyle.org/eclipse-cs/ and load our checkstyle.xml into it.
 
+Code Coverage Reports
+============
+
+The project uses Jacoco to measure unit tests code coverage, to generate a report run the following command: 
+
+    `./gradlew clean build jacocoTestReport`
+
+Generated reports can be found in build/code-coverage directory.
 
 Version
 ============
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 1a47593..6fea4db 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -26,6 +26,7 @@ project.ext.jerseyVersion = '1.17'
 buildscript {
   ext {
     openJPAVersion = '3.1.0'
+    jacocoVersion = '0.8.5'
   }
   repositories {
   	 jcenter()
@@ -66,6 +67,7 @@ apply plugin: 'openjpa'
 apply plugin: "com.github.spotbugs"
 apply plugin: 'checkstyle'
 apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
+apply plugin: 'jacoco'
 // apply plugin: 'pmd'
 
 dependencyManagement {
@@ -155,6 +157,19 @@ openjpa {
     }
 }
 
+jacoco {
+    toolVersion = jacocoVersion
+    reportsDir = file("$buildDir/reports/jacoco")
+}
+
+jacocoTestReport{
+    reports{
+        html.enabled=true
+        xml.enabled=true
+        html.destination file("${buildDir}/code-coverage")
+    }
+}
+
 rat {
   xmlOutput = false
   htmlOutput = false