-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fail to generate coverage and cannot run a report without it. #3
Comments
@amdonov Thanks for the report. Which bazel-sonarqube commit are you running with? And what's your build environment - particularly are you using a remote cache or buildfarm/buildbarn? Commit I'll make the coverage_report attribute properly optional to solve the workaround case. |
@amdonov Ok, I've made a couple of fixes for Bazel 2.1.0 compatibility - I don't think this was affecting you, but maybe. I've also fixed the None check for coverage_report, which hopefully unblocks you while we investigate the report generation issue. |
I tried building the coverage report with the latest commit. Initially, I received the error:
Same issue when I tried running the sonarqube target without the coverage report. I'm running bazel 1.2.1 locally on CentOS 7. |
To capture the Bazel 2.1.0 compatibility issue the dependencies are now mandatory -
I've cleaned up the dependency import (in case you already have bazel_skylib) and fixed the typo in master now. |
That was my mistake, I must have dropped those lines from WORKSPACE at some point. I can now run scanning without specifying a coverage report. However, I still unable to get a coverage report to generate successfully. Have you tested it on a golang project? This is the output I'm seeing.
The individual test folders are producing coverage.dat files. They're just not be aggregated correctly. Thanks for your help. |
I'm afraid I haven't done any testing with golang projects. That said, I would hope that if bazel's own coverage report is correct, the SQ format conversion will be fine. Then again I think bazel's approach to coverage isn't really final at the moment, so I don't know if there are language-specific oddities. Have you managed to get the lcov format aggregate coverage report working? IIRC you can do this with the param |
@amdonov Did you get it working? I am trying with golang project and seeing lot of issues |
Nope
…On Thu, Feb 4, 2021 at 10:36 AM Prashil Gupta ***@***.***> wrote:
@amdonov <https://github.com/amdonov> Did you get it working? I am trying
with golang project and seeing lot of issues
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOCFGS4NDO5XUT6FTMMUDS5K5JNANCNFSM4KQQURXQ>
.
|
Hi @amdonov, @prashilgupta, in a recent commit I updated the coverage collector to copy the latest changes from the upstream lcov coverage aggregator. Maybe this has had some effect on your issues? Since there were some changes upstream, I'd just like to re-verify: if you use the default lcov aggregator, do you definitely get a properly aggregated coverage report? I do really want to figure out if there's an issue here, so we need to pin down whether the issue is in "Bazel's coverage collection" or "bazel_sonarqube's coverage aggregation". Cutting this library out of the loop and checking the built in tooling will help there. The reason I ask is that one problem we found in #12 was a misconfigured java toolchain which was not actually generating coverage in the individual coverage.dat files (let alone the aggregation). The files appeared, but were empty - and when the coverage report generator ran the overall |
I used the following command and yes bazel command itself doesnt merge all coverage file into one dat for golang. But my issue was that I wasn't able to successfully use the sonarqube module with such wildcard target bazel coverage --combined_report=lcov --runs_per_test=1 --flaky_test_attempts=1 -- //... -//<exclude_target> |
Hello, I am hitting the exact same error with the latest commit from master and Bazel 4.0.0. I noticed that $ ls -lh bazel-myproject/coverage.launcher
lrwxr-xr-x 1 myuser wheel 61B 14 Feb 15:58 bazel-myproject/coverage.launcher -> bazel-out/host/bin/external/bazel_sonarqube/coverage.launcher
$ ls -lh bazel-myproject/bazel-out/host/bin/external/bazel_sonarqube
total 176
-r-xr-xr-x 1 myuser wheel 12K 14 Feb 15:53 SonarQubeCoverageGenerator
-r-xr-xr-x 1 myuser wheel 284B 14 Feb 15:57 SonarQubeCoverageGenerator-native-header.jar
-r-xr-xr-x 1 myuser wheel 11K 14 Feb 15:57 SonarQubeCoverageGenerator.jar
-rw-r--r-- 1 myuser wheel 1.1K 14 Feb 15:57 SonarQubeCoverageGenerator.jar-0.params
-rw-r--r-- 1 myuser wheel 170B 14 Feb 15:57 SonarQubeCoverageGenerator.jar-1.params
-r-xr-xr-x 1 myuser wheel 396B 14 Feb 15:57 SonarQubeCoverageGenerator.jar_manifest_proto
-r-xr-xr-x 1 myuser wheel 213B 14 Feb 15:57 SonarQubeCoverageGenerator.jdeps
drwxr-xr-x 7 myuser wheel 224B 14 Feb 15:53 SonarQubeCoverageGenerator.runfiles
-r-xr-xr-x 1 myuser wheel 38K 14 Feb 15:53 SonarQubeCoverageGenerator.runfiles_manifest
drwxr-xr-x 3 myuser wheel 96B 14 Feb 15:53 _javac It works if I use |
Trying to follow the example project you mentioned in issue #1
WORKSPACE
Added the following ~/.bazelrc
running bazel coverage //... produces the following error
If I try to remove coverage_report from the sonarqube rule, I get the following error
It's probably worth mentioning that I get the same thing if targets is removed. However, I was able to set it to an empty list.
The text was updated successfully, but these errors were encountered: