💚 Record coverage using the default Coverage plugin
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 1 Oct 2024 16:34:51 +0000 (18:34 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 2 Oct 2024 08:10:16 +0000 (10:10 +0200)
Jenkinsfile
build.gradle

index b60339f..f975642 100644 (file)
@@ -19,12 +19,13 @@ pipeline {
                 jdk 'OpenJDK 8'
             }
             steps {
-                sh './gradlew test'
+                sh './gradlew test jacocoTestReport'
             }
             post {
                 always {
                     junit 'build/test-results/*/*.xml'
                     jacoco classPattern: 'build/classes/*/main', sourcePattern: '**/src/main/'
+                    recordCoverage(tools: [[parser: 'JACOCO', pattern: '**/jacocoTestReport.xml']])
                 }
             }
         }
index 064b94f..b357d1b 100644 (file)
@@ -115,6 +115,9 @@ jacocoTestReport {
         include "jacoco/*.exec"
     })
     dependsOn test
+    reports {
+        xml.required = true
+    }
 }
 
 pitest {