-
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
Bazel coverage with --combined_report=lcov
fails
#6450
Comments
I get this as well, almost filed another bug because this isn't marked as a bug. My traceback is the same. Here's my bug details: What operating system are you running Bazel on?Ubuntu 16.04.4 LTS (inside a docker, inside Ubuntu 16.04.5 LTS) What's the output of
|
I get this traceback after setting the right flag:
|
I have the same problem as @fahhem getting exception
I am running command:
I don't get this exception when running coverage on Ubuntu 18.04.1 LTS Ls returns same on both Ubuntu and CentOS:
Using bazel 0.20.0 Please let me know if I can provide more debug information. |
Is this actually specific to java rules -- perhaps the 'team-Rules-Java' tag should be removed? 'bazel coverage' with the '--combined_report=lcov' appears to be broken. Still happening in bazel 0.21. Something that might be relevant: if I use However
|
I can second that this does not seem to be related to java. I get this for all kind of languages, eg:
|
is it true that, to this day, Java coverage doesn't work in Bazel? or am i missing some fix/change? this bug has been open since 2018. is there anything the community can do to help move it along? EDIT: or is it just |
It works, you just have to specify another flag on the command line when using
The default value of the Note: this issue is about getting a combined report with coverage data from all test runs. If |
@iirina EDIT: OK, I found it at the |
@iirina
results in a runtime exception:
Any idea? |
The reason was using |
@codesku thank you for sharing, that might save us too :( |
So what is correct command to generate the coverage output? |
Even if I disable
The problem seems to be, that it cannot find JDK:
|
Workaround suggested by codesuki bazelbuild/bazel#6450 (comment) Against Internal error thrown during build. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=com.google.devtools.build.lib.skyframe.CoverageReportValue$CoverageReportKey@7beaf6d6, actionIndex=1}' (requested by nodes ) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:531) at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:399) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException: null for File:[[<execution_root>]bazel-out/host/bin]external/bazel_tools/tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator/Main.jar at com.google.devtools.build.lib.skyframe.ActionMetadataHandler.getMetadata(ActionMetadataHandler.java:210) at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$DelegatingPairFileCache.getMetadata(SkyframeActionExecutor.java:1604) https://cirrus-ci.com/task/5105954051325952?command=measure_and_aggregate_coverage#L279
* Build coverage reports with Bazel * Gave up with aggregated report (combined_report) bazelbuild/bazel#6450 https://cirrus-ci.com/task/5105954051325952?command=measure_and_aggregate_coverage#L279 * Add code coverage as a Cirrus CI task * Add CODACY_PROJECT_TOKEN to Cirrus env variables * Remove Maven report-module
Author: Régis Décamps <regisd@google.com> Date: Tue Nov 26 00:18:30 2019 +0100 Send code coverage reports (#608) * Build coverage reports with Bazel * Gave up with aggregated report (combined_report) bazelbuild/bazel#6450 https://cirrus-ci.com/task/5105954051325952?command=measure_and_aggregate_coverage#L279 * Add code coverage as a Cirrus CI task * Add CODACY_PROJECT_TOKEN to Cirrus env variables * Remove Maven report-module Updated from target/jflex-parent-1.8.0-SNAPSHOT-sources.jar
From manual testing, this is fixed as of 934c4fd. |
I still have this issue with Bazel 2.0.0 |
I also still have this issue when running What operating system are you running Bazel on?MacOS Mojave Version 10.14.6 Output of bazel info release:
I'm on a C++ repo using GoogleTest. Output
|
@iirina seems like folks across languages are facing this issue. Any clue what the issue is?
|
The fix didn't make it into 2.0.0. |
Any ETA of when this might be merged? Looks like this is a widespread issue for people? |
It should work at HEAD, and I expect it to be in the next release, which is probably 2.1.0. |
There are a lot of affected users who are running with various lower versions. And there is significant amount of work to upgrade to 2.0.0 (or 2.1.0). Also, code coverage is import functionality to guarantee code quality. Is it possible to add some tests to make sure it won't break easily again? Thanks! |
@ulfjack / on 2.1.0, i'm getting an error still with this flag:
|
See my reply on #5426, which - I think - is the right bug. |
Just for anyone who stumbles across this issue like I do, I am using an old Bazel version: 0.24.0. There is a change in Bazel 0.19.0, you need to change into --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main to make it work. Release note here https://blog.bazel.build/2018/10/29/bazel-0.19.0.html |
This still happens at HEAD:
crashes with the following stack trace:
I'm fairly certain that this is due to a missing cc @c-mita |
That looks like the most likely reason for an NPE ( |
Yeah, that's all I'm asking for; one can't do much with a tool that's not executable, it's just that crashing is not acceptable. |
Description of the problem / feature request:
Running
bazel coverage --combined_report=lcov //...
results in aNullPointerException
It appears that the default value of
--coverage_report_generator
causes this. Running it with--coverage_report_generator="@bazel_tools//tools/test/LcovMerger/java/com/google/devtools/lcovmerger:Main"
works; though it should be pointed out that there are someSEVERE
logs.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Clone this repo: https://github.com/chris-rice-lr/bazel_combined_report_repro and run
Running
will result in a single
.dat
file as expectedWhat operating system are you running Bazel on?
Fedora 28
What's the output of
bazel info release
?If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.I used the COPR repo: https://copr.fedorainfracloud.org/coprs/vbatts/bazel/
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
This thread helped. It showed that running with
--coverage_report_generator
set correctly made it work. https://groups.google.com/forum/#!searchin/bazel-discuss/combined_report%7Csort:date/bazel-discuss/itJkJ2T4mWw/qNKGEk_uFAAJThe text was updated successfully, but these errors were encountered: