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

coverage: use lcov to merge multi-binary coverage report #10909

Merged
merged 18 commits into from
May 15, 2020

Conversation

lizan
Copy link
Member

@lizan lizan commented Apr 22, 2020

Description:
Use bazel lcov merger to merge coverage generated by llvm-cov export from multiple binary run. This improves coverage test stability by run them in separate sandbox.

Risk Level: Low (test only)
Testing: CI
Docs Changes: N/A
Release Notes: N/A

lizan added 6 commits April 22, 2020 22:56
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
@stale
Copy link

stale bot commented May 1, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label May 1, 2020
@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label May 5, 2020
lizan added 2 commits May 11, 2020 00:57
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
@lizan lizan marked this pull request as ready for review May 12, 2020 00:12
@lizan lizan requested a review from asraa May 12, 2020 00:12
Signed-off-by: Lizan Zhou <[email protected]>
@lizan
Copy link
Member Author

lizan commented May 12, 2020

@asraa PTAL but I think this effectively reverted #10289, will see if I can bring it back.

@lizan
Copy link
Member Author

lizan commented May 13, 2020

@asraa @htuch I brought fuzz back and this is ready for review.

@lizan lizan force-pushed the multi_binary_coverage branch from d3222fb to 7dc3d6b Compare May 13, 2020 10:51
Signed-off-by: Lizan Zhou <[email protected]>
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! The fuzz wrapper is unbelievably clean, TIL about --run_under.

Will look into stat merger fuzzing issue discussed offline https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21460

bazel/coverage/fuzz_coverage_wrapper.sh Outdated Show resolved Hide resolved
bazel/coverage/fuzz_coverage_wrapper.sh Show resolved Hide resolved
Signed-off-by: Lizan Zhou <[email protected]>
@lizan lizan merged commit 7a28514 into envoyproxy:master May 15, 2020
@lizan lizan deleted the multi_binary_coverage branch May 15, 2020 02:37
bazel-io pushed a commit to bazelbuild/bazel that referenced this pull request Oct 21, 2020
Support for coverage with clang in Bazel was half working because the report produced was in a binary format and it wasn't be utilized by the LCOV merger and therefore didn't show up in the final LCOV report.

This CL uses llvm-cov as was used by Envoy in envoyproxy/envoy#10909 to produce an LCOV report.

To run this the following environment variable and build flags are needed:
BAZEL_USE_LLVM_NATIVE_COVERAGE=1 GCOV={path to llvm_profdata} CC=clang \
    BAZEL_LLVM_COV={path to llvm_cov} bazel coverage --experimental_generate_llvm_lcov
PiperOrigin-RevId: 338254344
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants