-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add support for bazel coverage with BwoB #16475
Conversation
With `--experimental_split_coverage_postprocessing` and `experimental_fetch_all_coverage_outputs`, all that is needed to get coverage runs to succeed with `--remote_download_minimal` is to explicitly request the raw and processed coverage files. This is made possible by the machinery introduced for `--experimental_remote_download_regex`.
I am not sure whether using regex to pass the information around is the best option. As I mentioned in #6862 (comment), BwoB will be able to download output groups, can we somehow define an output group for those files? |
I agree that regexes are less than ideal. They have the benefit of working with I will look into the output group approach, I can't say yet whether it's feasible. |
the problem with In an incremental build, if you only change the requested regex, no additional intermediate files will be downloaded. However, |
It seems to be possible for the coverage reports created for individual tests to be included in an output group. We may need to explicitly fetch @coeuvre Do you have a branch with a prototype of the output group fetching functionality that I could use to test this approach with? |
not yet, but I plan to create a PR for that in a few days. |
Great, thanks. Just ping me when you have something. I will set this PR to draft for now. |
The PR #16524 is merged. It now listens to You can play with it but it may already be able to download coverage outputs in which case can you add an integration test for it? |
@coeuvre Just tested it, but the coverage outputs aren't downloaded. How would I go about registering them as test outputs? I have a commit that adds them to a new output group, but how would I register that with the downloader? |
The TestAttempt event is fired here. You can follow the If you think coverage outputs should be always downloaded by default if they exist, maybe just add them to the test output instead of using output group. |
It looks like coverage artifacts and reports are already declared outputs of the test action. However, the spawn that is supposed to take the coverage artifacts and generates a report from them fails to do so as it doesn't see the coverage artifacts. @coeuvre If a remotely run |
Yes, I remember it is the case so I said it may already works, but apparently, there are some other issues.
I think it should just work otherwise there are some bugs in Can you please share a minimal repro so I can look into? /cc @tjgq |
The integration tests added by this PR are reproducers (even if you replace I debugged this for a bit and think that the problem is the way the coverage tree artifact is created without properly registering it with Skyframe. That means that |
Adding slightly more detail: You assessed the situation in #15276 (comment). Either the spawn manually expands the tree artifact and doesn't pick up files that only exist remotely, or it sends a tree artifact that Not sure what the right direction is. Maybe looking into how tree artifacts created during the execution of the action could be injected into |
I have a working patch that just read tree artifacts from action fs. I will create a PR soon. |
Superseded by #16556 |
This PR solves the problem in a different way that #16475 tries to solve: 1. #16812 allows skyframe read metadata from ActionFS. 2. Use `ActionFileSystem` to check existence of coverage data. 3. Fire event `CoverageReport` in the action after the coverage report is generated and listen to it in `ToplevelArtifactsDownloader` to download the report. Closes #16556. PiperOrigin-RevId: 502854552 Change-Id: I2796baaa962857831ff161423be6dffa6eb73e5c
This PR solves the problem in a different way that bazelbuild#16475 tries to solve: 1. bazelbuild#16812 allows skyframe read metadata from ActionFS. 2. Use `ActionFileSystem` to check existence of coverage data. 3. Fire event `CoverageReport` in the action after the coverage report is generated and listen to it in `ToplevelArtifactsDownloader` to download the report. Closes bazelbuild#16556. PiperOrigin-RevId: 502854552 Change-Id: I2796baaa962857831ff161423be6dffa6eb73e5c
* Returns null if filesystem of test outputs is not ActionFS when processing test attempt event. Previously, we assert that the filesystem of test outputs is ActionFS when we are processing test attempt event. However this is not true when the test hits action cache. This CL looses the check to return null. PiperOrigin-RevId: 501023752 Change-Id: I17cbb26e0a2b5fd30cb781818e42172ac672919e * Make `bazel coverage` work with minimal mode This PR solves the problem in a different way that #16475 tries to solve: 1. #16812 allows skyframe read metadata from ActionFS. 2. Use `ActionFileSystem` to check existence of coverage data. 3. Fire event `CoverageReport` in the action after the coverage report is generated and listen to it in `ToplevelArtifactsDownloader` to download the report. Closes #16556. PiperOrigin-RevId: 502854552 Change-Id: I2796baaa962857831ff161423be6dffa6eb73e5c --------- Co-authored-by: kshyanashree <109167932+kshyanashree@users.noreply.github.com>
This PR solves the problem in a different way that #16475 tries to solve: 1. #16812 allows skyframe read metadata from ActionFS. 2. Use `ActionFileSystem` to check existence of coverage data. 3. Fire event `CoverageReport` in the action after the coverage report is generated and listen to it in `ToplevelArtifactsDownloader` to download the report. Closes #16556. PiperOrigin-RevId: 502854552 Change-Id: I2796baaa962857831ff161423be6dffa6eb73e5c
With
--experimental_split_coverage_postprocessing
andexperimental_fetch_all_coverage_outputs
, all that is needed to get coverage runs to succeed with--remote_download_minimal
is to explicitly request the raw and processed coverage files. This is made possible by the machinery introduced for--experimental_remote_download_regex
.Work towards #4685