[JIRA] (JENKINS-56918) Groovy Class Files Not Copied Over To View Code Coverage

11 views
Skip to first unread message

john.slater@openjawtech.com (JIRA)

unread,
Apr 5, 2019, 11:03:01 AM4/5/19
to jenkinsc...@googlegroups.com
John Slater updated an issue
 
Jenkins / Bug JENKINS-56918
Groovy Class Files Not Copied Over To View Code Coverage
Change By: John Slater
Priority: Minor Major
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

john.slater@openjawtech.com (JIRA)

unread,
Apr 5, 2019, 11:03:01 AM4/5/19
to jenkinsc...@googlegroups.com
John Slater created an issue
Issue Type: Bug Bug
Assignee: Ognjen Bubalo
Components: jacoco-plugin
Created: 2019-04-05 15:02
Priority: Minor Minor
Reporter: John Slater

As part of JENKINS-38604 a change was made to only copy over .java files. However this means any files with the .groovy extension can't be viewed. .groovy should be added to the list of make this a configurable option.

pavol.briatka@gmail.com (JIRA)

unread,
May 7, 2019, 11:48:02 AM5/7/19
to jenkinsc...@googlegroups.com
Pavol Briatka commented on Bug JENKINS-56918
 
Re: Groovy Class Files Not Copied Over To View Code Coverage

Hello, I think I had a similar issue. I could not see Kotlin files in Jenkins when I checked Jacoco coverage (error message: "Error while reading the sourcefile!") but I managed to solve it by putting the following line to my Jenkinsfile jacoco step configuration:
sourceInclusionPattern: '*/.*' 
Now both Java and Kotlin files are showed in reports. I checked the source code for JacocoPublisher where I found that the default value for String sourceInclusionPattern is indeed "*/.java" but you can rewrite it either in post-build actions tab in Jenkins or in your Jenkinsfile (depending on your implementation).
The above mentioned implementation will include all files from your source code (defined as sourcePattern)

pavol.briatka@gmail.com (JIRA)

unread,
May 7, 2019, 12:20:04 PM5/7/19
to jenkinsc...@googlegroups.com
Pavol Briatka edited a comment on Bug JENKINS-56918
Hello, I think I had a similar issue. I could not see Kotlin files in Jenkins when I checked Jacoco coverage (error message: _"Error while reading the sourcefile!"_) but I managed to solve it by putting the following line to my Jenkinsfile jacoco step configuration:
{code:java} sourceInclusionPattern: '**/*.*'   \{code}
Now both Java and Kotlin files are showed in reports. I checked the source code for JacocoPublisher where I found that the default value for String sourceInclusionPattern is indeed
\{code:java} "**/*.java" \{code} but you can rewrite it either in post-build actions tab in Jenkins or in your Jenkinsfile (depending on your implementation).

The above mentioned implementation will include all files from your source code (defined as sourcePattern)

pavol.briatka@gmail.com (JIRA)

unread,
May 7, 2019, 12:22:03 PM5/7/19
to jenkinsc...@googlegroups.com
Pavol Briatka edited a comment on Bug JENKINS-56918
Hello, I think I had a similar issue. I could not see Kotlin files in Jenkins when I checked Jacoco coverage (error message: _"Error while reading the sourcefile!"_) but I managed to solve it by putting the following line to my Jenkinsfile jacoco step configuration:

{code:java}
sourceInclusionPattern: '**/*.*' \
{code}
Now both Java and Kotlin files are showed in reports. I checked the source code for JacocoPublisher where I found that the default value for String sourceInclusionPattern is indeed
\{code: set to copy only java }"**/*.java"\{code} files but you can rewrite it either in post-build actions tab in Jenkins or in your Jenkinsfile (depending on your implementation).

The above mentioned implementation will include all files from your source code (defined as sourcePattern)

dominik.stadler@gmx.at (JIRA)

unread,
Sep 22, 2019, 6:26:02 PM9/22/19
to jenkinsc...@googlegroups.com
centic updated Bug JENKINS-56918
 

I adjusted the default to "*/.java,*/.groovy,*/.gs" for the next release, will probably be called 3.0.5

Change By: centic
Status: Open Fixed but Unreleased
Assignee: Ognjen Bubalo centic
Resolution: Fixed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

dominik.stadler@gmx.at (JIRA)

unread,
Sep 23, 2019, 4:03:02 PM9/23/19
to jenkinsc...@googlegroups.com
centic edited a comment on Bug JENKINS-56918
 
Re: Groovy Class Files Not Copied Over To View Code Coverage
I adjusted the default to "**/*.java,**/*.groovy,**/*. gs kt,**/*.kts " for the next release, will probably be called 3.0.5

dominik.stadler@gmx.at (JIRA)

unread,
Jan 25, 2020, 7:36:03 AM1/25/20
to jenkinsc...@googlegroups.com
Change By: centic
Status: Fixed but Unreleased Resolved
Released As: 3.0.5
Reply all
Reply to author
Forward
0 new messages