Skip to content

Have a general mechanism for collecting code coverage #5885

Open

Description

@iirina

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.

Activity

  1. added
    P2
    on Aug 14, 2018
  2. self-assigned this
    on Aug 14, 2018
  3. added
    team-Rules-CPP
    untriaged
    on Aug 14, 2018
  4. reopened this on Aug 28, 2018
  5. removed
    untriaged
    on Aug 28, 2018
  6. added
    team-Rules-Server
    and removed
    team-Rules-CPP
    on Mar 18, 2019
  7. Toxicable commented on Mar 29, 2019

    @Toxicable

    @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 )

  8. Globegitter commented on May 16, 2019

    @Globegitter

    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.

  9. Toxicable commented on Feb 1, 2020

    @Toxicable

    @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

  10. added
    P3
    and removed
    P2
    on Nov 18, 2020
  11. libratiger commented on Jan 10, 2022

    @libratiger
    Contributor

    is there any update for this feature?

  12. SoftwareApe commented on Jan 25, 2023

    @SoftwareApe

    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?

  13. github-actions commented on Mar 31, 2024

    @github-actions

    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.

  14. added
    stale
    on Mar 31, 2024
  15. SoftwareApe commented on Mar 31, 2024

    @SoftwareApe

    Not stale

  16. added
    not stale
    and removed
    stale
    on Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3coveragenot staleteam-Rules-Servertype: feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions