Skip to content

Commit c430010

Browse files
uhafnerNotMyFault
andauthored
[Jenkinsfile] Add source directory when recording coverage results (jenkinsci#7935)
* Add source directory when recording coverage results. JaCoCo does not store absolute paths in a coverage report, so the Jenkins coverage plugin needs to know where the source files are located. Otherwise, source code rendering and source referencing in GitHub checks does not work correctly. * Satisfy spotless --------- Co-authored-by: Alexander Brandes <[email protected]>
1 parent 0da73fe commit c430010

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Jenkinsfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ axes.values().combinations {
128128
if (folders.length > 1) {
129129
discoverGitReferenceBuild(scm: folders[1])
130130
}
131-
recordCoverage(tools: [[parser: 'JACOCO', pattern: 'coverage/target/site/jacoco-aggregate/jacoco.xml']], sourceCodeRetention: 'MODIFIED')
131+
recordCoverage(tools: [[parser: 'JACOCO', pattern: 'coverage/target/site/jacoco-aggregate/jacoco.xml']],
132+
sourceCodeRetention: 'MODIFIED', sourceDirectories: [[path: 'core/src/main/java']])
132133

133134
echo "Recording static analysis results for '${platform.capitalize()}'"
134135
recordIssues(

0 commit comments

Comments
 (0)