Repository navigation
bazel/coverage: Merge without Bazel's merger when it is not staged - #5591
Merged
Merged
Conversation
Bazel 7 runs the coverage output generator inside the test action (no split postprocessing) with only its executable staged: there is no runfiles tree beside it, and the test's own runfiles carry neither runfiles.bash nor Bazel's Java merger. The wrapper failed every test with "cannot find runfiles.bash", leaving a dangling `_coverage/gcov` link that fails the test's outputs. Without Bazel's merger, merge in the wrapper instead. For C++, the only input is the lcov that collect_cc_coverage.sh exports into the coverage directory, and the merge is what Bazel's merger does with it: rename reported sources to their actual paths (--sources_to_replace_file), drop sources matching --filter_sources, and keep only the sources in the source file manifest. Records are then stripped and the directory cleaned as before. Where Bazel's merger is available (Bazel 8 and up), nothing changes. Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 13, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
This was referenced Nov 13, 2026
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to envoyproxy/envoy
that referenced
this pull request
Nov 17, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
0.4.13.post3 has the coverage merger and llvm-cov wrapper backported to the WORKSPACE line (envoyproxy/toolshed#5588), used to postprocess coverage inside the test action, and its merge for Bazel 7, which does not stage Bazel's own merger in the test action (envoyproxy/toolshed#5591). 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 7 runs the coverage output generator inside the test action (no split postprocessing) with only its executable staged: there is no runfiles tree beside it, and the test's own runfiles carry neither
runfiles.bashnor Bazel's Java merger.lcov_merger.shtherefore failed every test withcannot find runfiles.bash, leaving a dangling_coverage/gcovlink that fails the test's outputs. Confirmed from a failing test action's inputs on EngFlow:bazel-out/<exec>/bin/external/envoy_toolshed/coverage/holds onlylcov_merger.sh, and nothing of@bazel_tools//tools/test:lcov_mergeris staged.Without Bazel's merger, the wrapper now merges itself. For C++ the only input is the lcov that
collect_cc_coverage.shexports into the coverage directory, and the merge is what Bazel's merger does with it:--sources_to_replace_file)--filter_sources--source_file_manifest)Records are then stripped and the coverage directory cleaned as before. Where Bazel's merger is available (Bazel 8 and up), nothing changes.
Adds a test running the merger with no runfiles tree, covering renaming, filtering, manifest selection, record stripping and cleanup.
Tested with Envoy's
release/v1.38(Bazel 7.7.1) on envoy-ci-staging (envoyproxy/envoy-ci-staging#2164), pinned to this commit: fuzz coverage executes and passes all 80 tests, where every run before failed at its first test.