Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a general mechanism for collecting code coverage #5885

Open
iirina opened this issue Aug 14, 2018 · 7 comments
Open

Have a general mechanism for collecting code coverage #5885

iirina opened this issue Aug 14, 2018 · 7 comments
Labels
coverage not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Server Issues for serverside rules included with Bazel type: feature request

Comments

@iirina
Copy link
Contributor

iirina commented Aug 14, 2018

Code coverage support in Bazel is poor and one reason is the lack of a general mechanism for collecting the code coverage information.

As briefly described in Bazel coverage design doc, the next steps towards a more general solution are:

  • Design and implement a coverage_toolchain
  • Migrate Bazel builtin C++ code coverage collection to use the new mechanism.
@iirina iirina added P2 We'll consider working on this in future. (Assignee optional) coverage labels Aug 14, 2018
@iirina iirina self-assigned this Aug 14, 2018
@aiuto aiuto added team-Rules-CPP Issues for C++ rules untriaged labels Aug 14, 2018
@iirina iirina closed this as completed Aug 28, 2018
@iirina iirina reopened this Aug 28, 2018
@iirina iirina removed the untriaged label Aug 28, 2018
@iirina iirina added team-Rules-Server Issues for serverside rules included with Bazel and removed team-Rules-CPP Issues for C++ rules labels Mar 18, 2019
@Toxicable
Copy link

@iirina I thought i'd post the instructions you left me here incase someone else is after a way to integrate with bazel coverage in the interm until this is better supported.


If the rules are written in Starlark, something helpful can be:

Bazel generates coverage reports in the lcov format. To work well with Bazel, your test rules also have to generate lcov reports under COVERAGE_DIR directory. Your test rule has to define the $lcov_merger attrbiute (similar to how Java tests do )

@Globegitter
Copy link

One thing that came up today - with this design of coverage collection is it possible to have another rule depend on the coverage output? We would like to write another rule that depends on the output and then creates a script that will upload the report on bazel run.

@Toxicable
Copy link

@iirina I'm taking another look at this but I havn't been able to figure out how to get COVERAGE_DIR defined.
This is this PR im working in and im running the test npx bazel coverage packages/jasmine/test:coverage_test but the only env var that's defined is LCOV_MERGER becasue I set it with coverage --test_env=LCOV_MERGER=/bin/true bazel-contrib/rules_nodejs#1135

@lberki lberki added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P2 We'll consider working on this in future. (Assignee optional) labels Nov 18, 2020
@libratiger
Copy link
Contributor

is there any update for this feature?

@SoftwareApe
Copy link

Is there any update on this? We desperately need code coverage with non-lcov tools. Is there at least some workaround where you define your toolchain and keep the instrumentation files and instrumentation executions with arbitrary extensions (e.g. *.csmes, *.o.csmes and *.o.csexe in the case of Squish Coco?

Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Mar 31, 2024
@SoftwareApe
Copy link

Not stale

@brentleyjones brentleyjones added not stale Issues or PRs that are inactive but not considered stale and removed stale Issues or PRs that are stale (no activity for 30 days) labels Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Server Issues for serverside rules included with Bazel type: feature request
Projects
None yet
Development

No branches or pull requests

9 participants