[cov,ci] Ensure all generated sources are available for coverage#30145
Open
sasdf wants to merge 3 commits into
Open
[cov,ci] Ensure all generated sources are available for coverage#30145sasdf wants to merge 3 commits into
sasdf wants to merge 3 commits into
Conversation
This aspect traverses the dependency graph to gather all files necessary for coverage reporting. This specific output group can be explicitly requested to ensure that the generated source files are available for analysis. Change-Id: I369c5a99937a98545d7d1909af05604905dca493 Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Adds the `coverage_sources_aspect` to the `ot_coverage` configuration. This aspect collects all source files into the `coverage_sources` output group for coverage report generation. Change-Id: I84e1394ae9007f4796d56dbeac25868182427abb Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
When running Bazel coverage, some generated sources might not be downloaded from remote cache if the test result is cached. This commit adds a build step with `--output_groups=coverage_sources` to ensure all relevant generated sources are available for coverage reporting. This is applied to both the `coverage-quick.yml` workflow and the `run-fpga-tests.sh` script. Change-Id: I189b3878c108db7bc3a94f97b9108664149a72ba Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
pamaury
approved these changes
May 19, 2026
Contributor
pamaury
left a comment
There was a problem hiding this comment.
That's a clever trick, but also a weird behaviour (yet another) of bazel.... Nice that you figured out a way!
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.
This PR fixes missing generated files for coverage report generation due to remote-cache.
By default, bazel only downloads the artifacts of top-level targets (i.e. targets specified in cmdline) from the remote cache, including test result / compiled libs... These artifacts does not include generated sources used to during compilation in the dependencies.
However, coverage report generation is executed outside of bazel environment, which requires the source code to be present locally.
This PR solves this issue by collecting all sources into the
coverage_sourcesoutput group, and request those files explicitly in CI before generating reports.Note:
bazel coveragealso accepts--output-groupsflag, but it won't download the files. We need to usebazel buildto fetch from remote cache.TEST: The tests in "CI / Coverage (quick) / Unit Tests (pull_request)" job are all cached, while its artifact contains generated sources correctly.