Repository navigation
bazel/coverage: Strip function and branch records from per-test lcov - #5580
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
phlax
force-pushed
the
coverage-lcov-strip
branch
from
November 9, 2026 23:12
38239f9 to
835e3e0
Compare
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
phlax
force-pushed
the
coverage-lcov-strip
branch
2 times, most recently
from
November 9, 2026 23:31
11e1a63 to
6509282
Compare
Bazel runs an lcov merger once per test, in the coverage postprocessing spawn, to produce that test's `coverage.dat`. In Envoy every one of those files describes the whole instrumented binary: 8.6MB for an integration test, of which 77% is function records (`FN`/`FNDA`, 25k mangled names) and 10% branch data (`BRDA`), repeated for all ~1,600 tests (~14GB per run) and then uploaded, downloaded and parsed again by the combined report, which only validates line coverage. Add `//coverage:lcov_merger`, a wrapper for `--coverage_output_generator` that passes its arguments through to Bazel's merger and then strips the configured record types (by default function and branch records) from the merged report in place. Line records are kept as they are, zero-hit lines included: the baseline report only lists files, so dropping them would hide uncovered lines rather than count them. The combined line coverage is unchanged; the HTML report omits its Functions column when no function records remain. The rule takes the merger to wrap and the record types to strip, so a consumer that wants function coverage can strip branches alone. Signed-off-by: Ryan Northey <[email protected]>
phlax
force-pushed
the
coverage-lcov-strip
branch
from
November 9, 2026 23:46
6509282 to
4c7594b
Compare
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 13, 2026
Port `//coverage:lcov_merger` and `//coverage:llvm_support` (the `llvm-cov` wrapper), with their tests, from `main` at bazel-v0.5.20, so that WORKSPACE consumers can postprocess coverage inside the test action as `main` does (envoyproxy#5580, envoyproxy#5582). With split postprocessing, each test uploads its raw profile for a separate action to download again. For Envoy that is about 140MB per integration test and 130GB per full coverage run. Inside the test action, the wrapper exports line coverage for workspace sources only, and the merger strips the records the report does not read and removes the coverage directory's intermediates before the test's outputs are uploaded. The files are unchanged from `main`. The report generation that came with them on `main` (`run`, `coverage_report`, the grcov and lcov merge repositories) is left out: WORKSPACE consumers have their own. Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 13, 2026
…#5588) Port `//coverage:lcov_merger` and `//coverage:llvm_support` (the `llvm-cov` wrapper), with their tests, from `main` at bazel-v0.5.20, so that WORKSPACE consumers can postprocess coverage inside the test action as `main` does (#5580, #5582). With split postprocessing, each test uploads its raw profile for a separate action to download again. For Envoy that is about 140MB per integration test and 130GB per full coverage run. Inside the test action, the wrapper exports line coverage for workspace sources only, and the merger strips the records the report does not read and removes the coverage directory's intermediates before the test's outputs are uploaded. The files are unchanged from `main`. The report generation that came with them on `main` (`run`, `coverage_report`, the grcov and lcov merge repositories) is left out: WORKSPACE consumers have their own. Signed-off-by: Ryan Northey <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bazel runs an lcov merger once per test, in the coverage postprocessing spawn, to produce that test's
coverage.dat. In Envoy every one of those files describes the whole instrumented binary: 8.6MB for an integration test, of which 77% is function records (FN/FNDA, 25k mangled names) and 10% branch data (BRDA), repeated for all ~1,600 tests (~14GB per run) and then uploaded, downloaded and parsed again by the combined report, which only validates line coverage.Add
//coverage:lcov_merger, a wrapper for--coverage_output_generatorthat passes its arguments through to Bazel's merger and then strips the configured record types (by default function and branch records) from the merged report in place. Line records are kept as they are, zero-hit lines included: the baseline report only lists files, so dropping them would hide uncovered lines rather than count them. The combined line coverage is unchanged; the HTML report omits its Functions column when no function records remain.The rule takes the merger to wrap and the record types to strip, so a consumer that wants function coverage can strip branches alone.