Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56918

Groovy Class Files Not Copied Over To View Code Coverage

    Details

    • Similar Issues:
    • Released As:
      3.0.5

      Description

      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.

        Attachments

          Activity

          Hide
          pavolbriatka Pavol Briatka added a comment - - edited

          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 set to copy only java 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)

          Show
          pavolbriatka Pavol Briatka added a comment - - edited 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 set to copy only java 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)
          Hide
          centic centic added a comment - - edited

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

          Show
          centic centic added a comment - - edited I adjusted the default to "* / .java,* / .groovy,* / .kt,* / .kts" for the next release, will probably be called 3.0.5

            People

            • Assignee:
              centic centic
              Reporter:
              john_slater John Slater
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: