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

Only java source files are processed, groovy, scala, gosu, etc. don't show coverage graphically

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After JaCoCo version 2.2.0 was released graphical code coverage display stoped working for non .java source files. Such as .groovy, .scala, .gs, .kt, etc.

      No code is displayed when viewing the coverage section of the reports.

       The JaCoCo log outputs:

      [JaCoCo plugin] Saving matched source directories for source-pattern: src: 
      [JaCoCo plugin] - /var/lib/jenkins/jobs/myjob/workspace/src 0 files
      [JaCoCo plugin] Loading inclusions files..
      

       Indicating 0 files were read from the source directory.

      The cause is related to this improvement Filter class directories JENKINS-38604

      Commit d771e0b15933516917208f30dd54bad81b1c290d introduced a change on line 472 of JacocoPublisher.java which restricts source files with the mask */.java

      Rolling back to version 2.1.0 of JaCoCo restores the expected behaviour.

      Can inclusions / exclusions filters be added similar to how class directories are filtered?

        Attachments

          Activity

          Hide
          spudmux Neal Hunter added a comment -

          Here is a list of extensions based on this List of JVM languages on wikipedia.

          Language Extensions
          Java .java
          Closure .clj, .cljs, .cljc, .edn
          Scala .scala, .sc
          Groovy .groovy
          Gosu .gs, .gsp, .gst, .gsx
          Kotlin .kt, .kts

          I'm not familiar with all the languages, so am unsure if it makes sense to include all of a given languages extensions.

          Are you thinking of hardcoding a list similar to the above and not allow user configuration. Or default the above and allow the user to further configure them?

          I can update or create a new PR as appropriate.

          Show
          spudmux Neal Hunter added a comment - Here is a list of extensions based on this List of JVM languages on wikipedia. Language Extensions Java .java Closure .clj, .cljs, .cljc, .edn Scala .scala, .sc Groovy .groovy Gosu .gs, .gsp, .gst, .gsx Kotlin .kt, .kts I'm not familiar with all the languages, so am unsure if it makes sense to include all of a given languages extensions. Are you thinking of hardcoding a list similar to the above and not allow user configuration. Or default the above and allow the user to further configure them? I can update or create a new PR as appropriate.
          Hide
          mheinzerling Martin Heinzerling added a comment - - edited

          >Or default the above and allow the user to further configure them?

          I think we have no other choice than that. If the config is empty, we use the list above, and otherwise the list the user specified. (Keep in mind to trim white spaces, there is already a bug in the comma separated paths )

          Will you please extend you PR accordingly? That would be fantastic.

          Show
          mheinzerling Martin Heinzerling added a comment - - edited >Or default the above and allow the user to further configure them? I think we have no other choice than that. If the config is empty, we use the list above, and otherwise the list the user specified. (Keep in mind to trim white spaces, there is already a bug in the comma separated paths ) Will you please extend you PR accordingly? That would be fantastic.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: spudmux
          Path:
          src/main/java/hudson/plugins/jacoco/JacocoPublisher.java
          src/main/java/hudson/plugins/jacoco/JacocoReportDir.java
          src/main/resources/hudson/plugins/jacoco/JacocoPublisher/config.jelly
          src/test/java/hudson/plugins/jacoco/JacocoPublisherTest.java
          http://jenkins-ci.org/commit/jacoco-plugin/9a26630717968c2dbe132fb7fafea77b7963cda4
          Log:
          JENKINS-43310 add source file inclusions and exclusions (#85)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: spudmux Path: src/main/java/hudson/plugins/jacoco/JacocoPublisher.java src/main/java/hudson/plugins/jacoco/JacocoReportDir.java src/main/resources/hudson/plugins/jacoco/JacocoPublisher/config.jelly src/test/java/hudson/plugins/jacoco/JacocoPublisherTest.java http://jenkins-ci.org/commit/jacoco-plugin/9a26630717968c2dbe132fb7fafea77b7963cda4 Log: JENKINS-43310 add source file inclusions and exclusions (#85)
          Hide
          centic centic added a comment -

          As the update to the PR never materialized, I have pushed the current version where *.java is used as default and people can enter a different pattern for source files if necessary. Will be included in the next release of the plugin.

          Show
          centic centic added a comment - As the update to the PR never materialized, I have pushed the current version where *.java is used as default and people can enter a different pattern for source files if necessary. Will be included in the next release of the plugin.
          Hide
          matejdro Matej Dro added a comment -

          Any ETA when can we expect new release with this fixed?

          Thanks.

          Show
          matejdro Matej Dro added a comment - Any ETA when can we expect new release with this fixed? Thanks.

            People

            • Assignee:
              spudmux Neal Hunter
              Reporter:
              spudmux Neal Hunter
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: