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

Jacoco report rendering problem in multi module projects

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline-maven-plugin
    • None
    • linux

      Upon upgrading to the latest pipeline-maven-plugin (3.5.14), all of our Jacoco report renderings have gone haywire. 

      Specifically, there are 17 "Coverage Trend" links on a branch's side bar, and many trend graphs. 

      The same is true on each individual build page.

      We are using a multi-branch pipeline, using "withMaven".  Our project is a multi-module maven build.

      There is a seemingly related stacktrace in the jenkins logs that I will also include on this issue.

          [JENKINS-54139] Jacoco report rendering problem in multi module projects

          Keith Collison added a comment - google groups discussion link: https://groups.google.com/d/msg/jenkinsci-users/bJ2DGVTWP_Y/UnbtqQh9AwAJ

          As a workaround, can you disable the automated publishing of the jacoco report publisher of the pipeline maven plugin:

          • Navigate to "Manage Jenkins / Global Tools Configuration"
          • In the "Pipeline Maven configuration" section, click on "Add Publisher Options" and select "Jacoco Publisher"
          • Check the "Disabled" checkbox
          • Save the configuration

          I'll look at the bug asap

          Cyrille Le Clerc added a comment - As a workaround, can you disable the automated publishing of the jacoco report publisher of the pipeline maven plugin: Navigate to "Manage Jenkins / Global Tools Configuration" In the "Pipeline Maven configuration" section, click on "Add Publisher Options" and select "Jacoco Publisher" Check the "Disabled" checkbox Save the configuration I'll look at the bug asap

          Note: The challenge is that the Jacoco Plugin Publisher, when invoked multiple times in a pipeline, is adding new "actions" and widgets on the screens rather than aggregating as publishers like the Junit Publisher is doing.

          https://github.com/jenkinsci/jacoco-plugin/blob/jacoco-3.0.3/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java#L660

          final JacocoBuildAction action = JacocoBuildAction.load(run, healthReports, taskListener, reportDir, includes, excludes);
          action.getThresholds().ensureValid();
          logger.println("[JaCoCo plugin] Thresholds: " + action.getThresholds());
          run.addAction(action);
          

          https://github.com/jenkinsci/junit-plugin/blob/junit-1.26.1/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java#L171

          TestResultAction action = build.getAction(TestResultAction.class);
          boolean appending;
          if (action == null) {
              appending = false;
              action = new TestResultAction(build, result, listener);
          } else {
              appending = true;
              result.freeze(action);
              action.mergeResult(result, listener);
          }
          

          Cyrille Le Clerc added a comment - Note: The challenge is that the Jacoco Plugin Publisher, when invoked multiple times in a pipeline, is adding new "actions" and widgets on the screens rather than aggregating as publishers like the Junit Publisher is doing. https://github.com/jenkinsci/jacoco-plugin/blob/jacoco-3.0.3/src/main/java/hudson/plugins/jacoco/JacocoPublisher.java#L660 final JacocoBuildAction action = JacocoBuildAction.load(run, healthReports, taskListener, reportDir, includes, excludes); action.getThresholds().ensureValid(); logger.println( "[JaCoCo plugin] Thresholds: " + action.getThresholds()); run.addAction(action); https://github.com/jenkinsci/junit-plugin/blob/junit-1.26.1/src/main/java/hudson/tasks/junit/JUnitResultArchiver.java#L171 TestResultAction action = build.getAction(TestResultAction.class); boolean appending; if (action == null ) { appending = false ; action = new TestResultAction(build, result, listener); } else { appending = true ; result.freeze(action); action.mergeResult(result, listener); }

          Cyrille Le Clerc added a comment - - edited

          prospero238 can you please test version 3.5.15-beta-3 no longer disabling the Jacoco publisher. withMaven will detect that multiple jacoco reports have been generated and will not publish reports automatically.

          https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.5.15-beta-3

          Cyrille Le Clerc added a comment - - edited prospero238 can you please test version 3.5.15-beta-3 no longer disabling the Jacoco publisher. withMaven will detect that multiple jacoco reports have been generated and will not publish reports automatically. https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.5.15-beta-3

          there is a glitch in the beta-3 release, the fix is missing. Please wait for the beta-4 release

          Cyrille Le Clerc added a comment - there is a glitch in the beta-3 release, the fix is missing. Please wait for the beta-4 release

          Cyrille Le Clerc added a comment - Here is the right version https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/pipeline-maven/3.5.15-beta-4/pipeline-maven-3.5.15-beta-4.hpi

          Fixed in 3.5.15

          Cyrille Le Clerc added a comment - Fixed in 3.5.15

          Falko Modler added a comment -

          Cross-reference which might help other users who are trying to figure out how to create one big report for multipe maven modules:
          https://issues.jenkins-ci.org/browse/JENKINS-54038?focusedCommentId=359814&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-359814

          Falko Modler added a comment - Cross-reference which might help other users who are trying to figure out how to create one big report for multipe maven modules: https://issues.jenkins-ci.org/browse/JENKINS-54038?focusedCommentId=359814&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-359814

            cleclerc Cyrille Le Clerc
            prospero238 Keith Collison
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: