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

Missing coverage diff after upgrading from 1.10.0 to 1.11.1

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • coverage-plugin
    • None

      I updated the coverage plugin from version 1.10.0 to 1.11.1 and I am now facing missing coverage values - both for the corresponding column as well as for the custom logic relying on 

      io.jenkins.plugins.coverage.metrics.steps.CoverageBuildAction.getStatistics()

      Example: Using

      println action.getStatistics().projectValueMapping
      println action.getStatistics().changeValueMapping
      println action.getStatistics().fileValueMapping 

      inside the script console yields

      [MODULE: 100.00% (1/1), PACKAGE: 88.10% (111/126), FILE: 80.98% (481/594), CLASS: 80.98% (481/594), LINE: 66.53% (22239/33428), BRANCH: 59.03% (7577/12836), COMPLEXITY: 0, COMPLEXITY_DENSITY: 0/33428, LOC: 33428]
      []
      [] 

      now without having changed anything on my side (`action` is the `CoverageBuildAction` of the current build).

          [JENKINS-72770] Missing coverage diff after upgrading from 1.10.0 to 1.11.1

          Ulli Hafner added a comment - - edited

          The delta build computation has been moved to the forensics plugin. You either need to compute a reference build with the discoverReferenceBuild or discoverGitReferenceBuild before you invoke the coverage reporter.

          Ulli Hafner added a comment - - edited The delta build computation has been moved to the forensics plugin . You either need to compute a reference build with the discoverReferenceBuild or discoverGitReferenceBuild before you invoke the coverage reporter.

          Stefan added a comment - - edited

          drulli Is this documented anywhere? I could not find a useful hint about this breaking change in the changelog, except that this is advertised as new feature/bugfix. There is some documentation in https://plugins.jenkins.io/coverage/#plugin-content-selecting-a-baseline-in-the-target-job , but this does not cover the case where I just want to use the previous build? Is

          discoverReferenceBuild() 

          the correct approach?

          Stefan added a comment - - edited drulli Is this documented anywhere? I could not find a useful hint about this breaking change in the changelog, except that this is advertised as new feature/bugfix. There is some documentation in https://plugins.jenkins.io/coverage/#plugin-content-selecting-a-baseline-in-the-target-job , but this does not cover the case where I just want to use the previous build? Is discoverReferenceBuild() the correct approach?

          Ulli Hafner added a comment -

          Yes exactly, this is the way to re-enable the delta. I forgot to document this simple variant as I normally create only git-delta results.

          Ulli Hafner added a comment - Yes exactly, this is the way to re-enable the delta. I forgot to document this simple variant as I normally create only git-delta results.

            drulli Ulli Hafner
            stefan6419846 Stefan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: