bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.97k stars 4.03k forks source link

Have `bazel coverage` output Cobertura XML #17314

Open noel-yap opened 1 year ago

noel-yap commented 1 year ago

Description of the feature request:

https://github.com/bazelbuild/bazel/issues/1118 and https://github.com/bazelbuild/bazel/issues/5246 mention having bazel coverage output Cobertura XML. What's the status of this?

What underlying problem are you trying to solve with this feature?

I'd like to use bazel coverage with https://bazel.build/configure/coverage.

Which operating system are you running Bazel on?

Linux, Mac

What is the output of bazel info release?

release 5.3.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

Not applicable.

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

Not applicable

sgowroji commented 1 year ago

Hello @noel-yap, Could you please elaborate your query with complete details. Thanks!

noel-yap commented 1 year ago

My query is about the status of the work to have bazel coverage output Cobertura XML. I've updated the query and provided answers to the other questions. Any other details I can provide?

c-mita commented 1 year ago

There are currently no plans to add XML output support to Bazel; it may get some consideration in the future, but it would likely be just plugging in the genhtml step we advise in the documentation.

imcdo commented 1 year ago

+1 this request

frbender commented 1 year ago

This would be a huge help for python developers! :)

The use case is to use Bazel with code quality tools such as Sonarcloud/SonarQube. Unfortunately, tools like Sonarcloud expect XML coverage reports for languages such as Python, Java and Scala as for those languages, it's the more common output option. Of course, for C and similar languages this might be different.

(Just for reference, here's what I am referring to: https://docs.sonarcloud.io/enriching/test-coverage/test-coverage-parameters/)

KarimH22 commented 1 year ago

Hello +1 to get xml report and not .dat some report generator tools prefer xml thanks

c-mita commented 1 year ago

I'm re-opening this because of the discussion I started here: https://github.com/bazelbuild/bazel/discussions/19144

xiaozhi747 commented 4 months ago

Is there any new progress on this issue? @c-mita

c-mita commented 4 months ago

No.

I don't think Bazel will ever "operate" on or with XML files (it's not a good format for cross-language operations, merging across multiple runs, etc).

It's possible that we may one day bundle an "lcov to XML" converter, but it's a low priority.