Add Jacoco to measure code coverage (FINERACT-725 / PR #742)

* Added Code Coverage Section in Readme
This commit is contained in:
Manthan Surkar
2020-04-01 23:29:15 +02:00
committed by GitHub
parent 4ccbcba3a6
commit 402c41dd95
2 changed files with 23 additions and 0 deletions
+8
View File
@@ -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). 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. 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 Version
============ ============
+15
View File
@@ -26,6 +26,7 @@ project.ext.jerseyVersion = '1.17'
buildscript { buildscript {
ext { ext {
openJPAVersion = '3.1.0' openJPAVersion = '3.1.0'
jacocoVersion = '0.8.5'
} }
repositories { repositories {
jcenter() jcenter()
@@ -66,6 +67,7 @@ apply plugin: 'openjpa'
apply plugin: "com.github.spotbugs" apply plugin: "com.github.spotbugs"
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin' apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
apply plugin: 'jacoco'
// apply plugin: 'pmd' // apply plugin: 'pmd'
dependencyManagement { 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 { rat {
xmlOutput = false xmlOutput = false
htmlOutput = false htmlOutput = false