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

Cobertura plugin does not provide data to the REST API

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Accessing data from the Cobertura plugin via the REST API is not possible.

      Hitting the URL http://<jenkins>/job/<name>/<build>/cobertura/api/xml gives:

      <coverageResult><results/></coverageResult>

      and .../api/json gives:

      { results: { } }

      If either depth=2 or appropriate tree argument is given, data is returned, but not all information that is seen on the html pages. Specifically the totals (e.g number of lines) used to generate the ratios is missing. Because of this one cannot determine the relative sizes of the components or the overall size of the project.

        Attachments

          Activity

          Hide
          sogabe sogabe added a comment -

          use http://<jenkins>/job/<name>/<build>/cobertura/api/xml?depth=2

          Show
          sogabe sogabe added a comment - use http://<jenkins>/job/<name>/<build>/cobertura/api/xml?depth=2
          Hide
          jglick Jesse Glick added a comment -

          Better still, use the tree parameter to retrieve exactly those fields you are interested in, rather than relying on whatever the plugin developer thought might be useful at a given depth.

          Show
          jglick Jesse Glick added a comment - Better still, use the tree parameter to retrieve exactly those fields you are interested in, rather than relying on whatever the plugin developer thought might be useful at a given depth .
          Hide
          kimonp Kimon Papahadjopoulos added a comment -

          Depth does indeed work. However, the information given is not complete. Specifically, it gives the coverage ratios, but it doesn't give for example the number of uncovered lines vs. the number of lines, like you can see from the web page. So you can't tell the overall size of the project, nor the size of any particular component.

          Show
          kimonp Kimon Papahadjopoulos added a comment - Depth does indeed work. However, the information given is not complete. Specifically, it gives the coverage ratios, but it doesn't give for example the number of uncovered lines vs. the number of lines, like you can see from the web page. So you can't tell the overall size of the project, nor the size of any particular component.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ssogabe
          Path:
          src/main/java/hudson/plugins/cobertura/targets/CoverageTreeElement.java
          http://jenkins-ci.org/commit/cobertura-plugin/bcc09dbcf541ecab95b68b5dfadd5bc70c9e974b
          Log:
          [FIXED JENKINS-13877] Cobertura plugin does not provide data to the REST API

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ssogabe Path: src/main/java/hudson/plugins/cobertura/targets/CoverageTreeElement.java http://jenkins-ci.org/commit/cobertura-plugin/bcc09dbcf541ecab95b68b5dfadd5bc70c9e974b Log: [FIXED JENKINS-13877] Cobertura plugin does not provide data to the REST API

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              joey Joey W
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: