Feature: Support Cobertura output format for coverage · Issue #1114 · jacoco/jacoco · GitHub
Skip to content

Feature: Support Cobertura output format for coverage #1114

Closed

Description

@dragetd
  • JaCoCo version: JaCoCo 0.8.5.201910111838
  • Operating system: Gentoo x86 linux-5.4.72-gentoo
  • Tool integration: Maven / Gradle
  • Description of your use case:

I am using Jacoco in a CI/CD envionrment with GitLab. GitLab is an alternative Git-based platform for project-management that has integrated CI/CD functionality. It allows parsing Cobertura based coverage reports and integrating them directly in the Diff view for a merge request. The functionality is described here: https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html#maven-example

The recommendation is to use the well supported and modern coverage tool Jacoco. But the common parsing format for coverage is based on Cobertura. To bridge that gap, they recommend using two little converter scripts that convert the coverage report to Cobertura compatible format, based on these scripts: https://gitlab.com/haynes/jacoco2cobertura

Eventho this is a viable approach, I wonder how difficult it would be to implement a feature to output Cobertura format directly from JaCoCo.

A random example for the format I found online:
https://gist.github.com/apetro/fcfffb8c4cdab2c1061d

Possible Workarounds

If such functionality is out of the scope of this project, I do not think there is any viable workaround. Instead, users should use scripts like https://gitlab.com/haynes/jacoco2cobertura or GitLab should integrate parsing the JaCoCo XML format.

Activity

  1. marchof commented on Oct 23, 2020

    @marchof
    Member

    Indeed, this is out of scope of the project. Please understand that we cannot maintain file formats of other products - especially if those products are not actively maintained any more.

  2. dragetd commented on Oct 26, 2020

    @dragetd
    Author

    The reasoning was, that this is a common format used also by other projects.

    Examples:

    So it is pretty far spread, little chance of ever changing. I would still love to see support for it, but understand, that there is no interest from your side. Would you still prefer not to support it, even it was contributed externally via a PR?

  3. marchof commented on Oct 26, 2020

    @marchof
    Member

    This can be a perfect tool separate from JaCoCo.

    Please understand that we have no time to take care of all the questions and issue that arise from the integration with all those tools, especially if we don't own the file format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions