-
Notifications
You must be signed in to change notification settings - Fork 278
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
Coverage with custom jacocorunner jar file - what am I doing wrong? #1453
Comments
Checked out rules_scala at I then edited the test.sh file to use the bazel 5 version: build_local_jacocorunner() {
- $root_dir/scripts/build_jacocorunner/build_jacocorunner.sh
+ $root_dir/scripts/build_jacocorunner/build_jacocorunner_bazel_5.0+.sh
cp /tmp/bazel_jacocorunner_build/JacocoCoverage_jarjar_deploy.jar $root_dir/manual_test/coverage_local_jacocorunner
} $ cd manual_test/coverage_local_jacocorunner
$ ./test.sh With the custom jar built (all mvn tests passed), packed it into a zip file: $ jar -cfM jacoco-coverage-73f5d1.zip ./JacocoCoverage_jarjar_deploy.jar And uploaded that zip file here: |
The zip file can be consumed as an http_archive(
name = "rules_scala_jacocorunner",
sha256 = "1e21d640ac5e39bff30c6255b2de389b0a53adf2338aeeeb5a656b13de11ba2b",
urls = ["https://github.com/bazelbuild/rules_scala/files/10109719/jacoco-coverage-73f5d1.zip"],
build_file_content = """
filegroup(
name = "jar",
srcs = ["JacocoCoverage_jarjar_deploy.jar"],
visibility = ["//visibility:public"],
)
""",
) |
A custom scala_toolchain was setup: load("@io_bazel_rules_scala//scala:scala_toolchain.bzl", "scala_toolchain")
scala_toolchain(
name = "jacocorunner_toolchain_impl",
jacocorunner = "@rules_scala_jacocorunner//:jar",
unused_dependency_checker_mode = "error",
visibility = ["//visibility:public"],
)
toolchain(
name = "jacocorunner_scala_toolchain",
toolchain = "jacocorunner_toolchain_impl",
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type",
visibility = ["//visibility:public"],
) |
The toolchain was registered in the register_toolchains(
"//bazel_tools/scala:jacocorunner_scala_toolchain",
) |
Salient
|
Despite all this, coverage.dat files are always empty:
$ du -sh /private/var/tmp/_bazel_i868039/f9bbdd40f3eca77219d10972abb94836/execroot/foo/bazel-out/_coverage/_coverage_report.dat
0 /private/var/tmp/_bazel_i868039/f9bbdd40f3eca77219d10972abb94836/execroot/foo/bazel-out/_coverage/_coverage_report.dat
|
|
cc @gergelyfabian any suggestions here? |
Did you try playing with the --instrumentation_filter parameter? |
Please check https://github.com/gergelyfabian/bazel-scala-example. I've updated it to use Bazel 5.3.2 and Java 17. Tried with: bazel coverage //...
lcov --list bazel-out/_coverage/_coverage_report.dat |
rules_scala is on version |
Indeed things are working in that example, with the custom
Clearly something different about the repository I'm using it within (not sure yet what it is) but at least this is a good sanity check so thank you @gergelyfabian for setting up this example. |
Just leaving a trail here for my future self, or someone else... Seeing an exception from the jacocorunner, not sure what it means yet. In the repo I'm working with, copying the Here's what I see with
Particularly the permission denied bit:
|
It seems your test runner reported a success, but then Bazel reports a
failure. It seems there is a permission error, right at the end of the log.
Check maybe whether Bazel can create coverage report files.
In general coverage support works with rules_scala. The last case I saw and
fixed in my project was some Scala files did not have a matching location
(in the file system) and package name (as in the Java convention). In that
case no coverage was reported, but without a failure. It was fixed by
adjusting the folder structure to the package names.
Paul Cody Johnston ***@***.***> ezt írta (időpont: 2022. dec.
17., Szo 19:13):
… Just leaving a trail here for my future self, or someone else... Seeing an
exception from the jacocorunner, not sure what it means yet.
In the repo I'm working with, copying the example-lib/ into it and
running coverage works for those simple targets. But running it for "real"
targets always yields empty coverage.dat files.
Here's what I see with --test_env=VERBOSE_COVERAGE=1 flag:
bazel coverage \
//common/utils/caseclass/... \
--experimental_fetch_all_coverage_outputs \
--instrumentation_filter=//common/utils/caseclass \
--test_output=all \
--experimental_split_coverage_postprocessing \
--test_env=VERBOSE_COVERAGE=1
--spawn_strategy=standalone
INFO: Invocation ID: 612902eb-19b6-48b3-99c8-541a00a179dd
Loading:
Loading: 0 packages loaded
Analyzing: 2 targets (0 packages loaded, 0 targets configured)
DEBUG: /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/external/io_bazel_rules_scala/scala/private/phases/phase_coverage.bzl:57:14: running jacoco instrumenter! //trumid/common/utils/caseclass:scala
DEBUG: /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/external/io_bazel_rules_scala/scala/private/phases/phase_coverage_runfiles.bzl:27:18: coverage runfile: tools/JacocoCoverage_jarjar_deploy.jar
DEBUG: /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/external/io_bazel_rules_scala/scala/private/phases/phase_coverage_runfiles.bzl:27:18: coverage runfile: ../remote_coverage_tools/Main.jar
DEBUG: /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/external/io_bazel_rules_scala/scala/private/phases/phase_coverage_runfiles.bzl:27:18: coverage runfile: ../remote_coverage_tools/Main
DEBUG: /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/external/io_bazel_rules_scala/scala/private/phases/phase_coverage_runfiles.bzl:27:18: coverage runfile: trumid/common/utils/caseclass/scala-offline.jar
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 1 target and 1 test target...
[3 / 6] [Prepa] BazelWorkspaceStatusAction stable-status.txt ... (2 actions, 0 running)
FAIL: //trumid/common/utils/caseclass:tests (see /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/test.log)
INFO: From Testing //trumid/common/utils/caseclass:tests:
==================== Test output for //trumid/common/utils/caseclass:tests:
+ [[ -z bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files ]]
+ export ROOT=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity
+ ROOT=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity
+ [[ bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files != /* ]]
+ export COVERAGE_MANIFEST=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files
+ COVERAGE_MANIFEST=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files
+ export COVERAGE_DIR=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ COVERAGE_DIR=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ [[ bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage == /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity* ]]
+ COVERAGE_DIR=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ mkdir -p /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ COVERAGE_OUTPUT_FILE=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat
+ [[ bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat == /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity* ]]
+ COVERAGE_OUTPUT_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat
+ export JAVA_COVERAGE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/jvcov.dat
+ JAVA_COVERAGE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/jvcov.dat
+ export COVERAGE=1
+ COVERAGE=1
+ export BULK_COVERAGE_RUN=1
+ BULK_COVERAGE_RUN=1
+ [[ -z '' ]]
+ export GCOV_PREFIX_STRIP=3
+ GCOV_PREFIX_STRIP=3
+ export GCOV_PREFIX=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ GCOV_PREFIX=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ export LLVM_PROFILE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/%h-%p-%m.profraw
+ LLVM_PROFILE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/%h-%p-%m.profraw
+ [[ ! -z '' ]]
+ [[ 0 == \0 ]]
+ cd /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.sh.runfiles/unity
+ [[ 1 == \0 ]]
+ /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.sh.runfiles/unity/trumid/common/utils/caseclass/tests.sh
Discovery starting.
Discovery completed in 58 milliseconds.
Run starting. Expected test count is: 1
CaseClassFactoryTest:
- should instantiate a case class from it's corresponding tuple (7 milliseconds)
Run completed in 100 milliseconds.
Total number of tests run: 1
Suites: completed 2, aborted 0
Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
+ TEST_STATUS=0
+ [[ 0 -ne 0 ]]
+ [[ 1 == \1 ]]
+ [[ 0 == \0 ]]
+ exit 0
+ [[ -z bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files ]]
+ export ROOT=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity
+ ROOT=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity
+ [[ bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files != /* ]]
+ export COVERAGE_MANIFEST=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files
+ COVERAGE_MANIFEST=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/trumid/common/utils/caseclass/tests.instrumented_files
+ export COVERAGE_DIR=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ COVERAGE_DIR=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ [[ bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage == /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity* ]]
+ COVERAGE_DIR=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ mkdir -p /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ COVERAGE_OUTPUT_FILE=bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat
+ [[ bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat == /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity* ]]
+ COVERAGE_OUTPUT_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat
+ export JAVA_COVERAGE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/jvcov.dat
+ JAVA_COVERAGE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/jvcov.dat
+ export COVERAGE=1
+ COVERAGE=1
+ export BULK_COVERAGE_RUN=1
+ BULK_COVERAGE_RUN=1
+ [[ -z '' ]]
+ export GCOV_PREFIX_STRIP=3
+ GCOV_PREFIX_STRIP=3
+ export GCOV_PREFIX=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ GCOV_PREFIX=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
+ export LLVM_PROFILE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/%h-%p-%m.profraw
+ LLVM_PROFILE_FILE=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage/%h-%p-%m.profraw
+ [[ ! -z '' ]]
+ [[ 1 == \0 ]]
+ [[ 1 == \1 ]]
+ [[ 1 == \0 ]]
+ [[ 1 == \1 ]]
+ [[ 1 == \1 ]]
+ touch /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/coverage.dat
+ cd /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity
+ [[ -n '' ]]
+ [[ -z bazel-out/darwin_arm64-fastbuild/bin/external/remote_coverage_tools/Main ]]
+ for name in "$LCOV_MERGER"
+ [[ ! -e bazel-out/darwin_arm64-fastbuild/bin/external/remote_coverage_tools/Main ]]
+ [[ 1 == \1 ]]
++ resolve_links /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
++ local name=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage
++ '[' -e /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/trumid/common/utils/caseclass/tests/_coverage ']'
++ '[' -L /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage ']'
++ echo /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage
+ COVERAGE_DIR=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage
++ resolve_links /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files
++ local name=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files
++ '[' -e /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files ']'
++ '[' -L /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files ']'
++ echo /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files
+ COVERAGE_MANIFEST=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files
+ LCOV_MERGER_CMD='bazel-out/darwin_arm64-fastbuild/bin/external/remote_coverage_tools/Main --coverage_dir=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage --output_file=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/coverage.dat --filter_sources=/usr/bin/.+ --filter_sources=/usr/lib/.+ --filter_sources=/usr/include.+ --filter_sources=/Applications/.+ --filter_sources=.*external/.+ --source_file_manifest=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files'
+ [[ -n '' ]]
+ [[ -n '' ]]
+ JAVA_RUNFILES=
+ exec bazel-out/darwin_arm64-fastbuild/bin/external/remote_coverage_tools/Main --coverage_dir=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage --output_file=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/coverage.dat --filter_sources=/usr/bin/.+ --filter_sources=/usr/lib/.+ --filter_sources=/usr/include.+ --filter_sources=/Applications/.+ '--filter_sources=.*external/.+' --source_file_manifest=/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/bin/common/utils/caseclass/tests.instrumented_files
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main getTracefiles
INFO: Found 1 tracefiles.
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main parseFilesSequentially
INFO: Parsing file /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/_coverage/jvcov11223020425242003820.dat
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main getGcovInfoFiles
INFO: No gcov info file found.
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main getGcovJsonInfoFiles
INFO: No gcov json file found.
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main getProfdataFileOrNull
INFO: No .profdata file found.
Dec 17, 2022 6:12:20 PM com.google.devtools.coverageoutputgenerator.Main runWithArgs
WARNING: There was no coverage found.
java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2170)
at com.google.testing.coverage.JacocoCoverageRunner.getUniquePath(JacocoCoverageRunner.java:345)
at com.google.testing.coverage.JacocoCoverageRunner$2.run(JacocoCoverageRunner.java:519)
================================================================================
INFO: LCOV coverage report is located at /private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/_coverage/_coverage_report.dat
and execpath is bazel-out/_coverage/_coverage_report.dat
INFO: Elapsed time: 0.933s, Critical Path: 0.67s
INFO: 2 processes: 1 internal, 1 local.
INFO: Build completed, 1 test FAILED, 2 total actions
//common/utils/caseclass:tests FAILED in 0.5s
/private/var/tmp/_bazel_pcj/d7e82b68b84ece06dc82c3639a1eabcf/execroot/unity/bazel-out/darwin_arm64-fastbuild/testlogs/common/utils/caseclass/tests/test.log
Executed 1 out of 1 test: 1 fails locally.
INFO: Build completed, 1 test FAILED, 2 total actions
—Message ID: ***@***.***>
|
Having the custom JacocoRunner build script, you could go and modify
JacocoRunner and add some debugging around the code that you see in the
trace, to check accessing which exact file results in a permission denied
error.
… Message ID: ***@***.***>
>
|
Circling back to this to note that, some time ago, I created https://github.com/stackb/bazel-jacocorunner. |
Trying to get coverage working for a repository after upgrading rules_scala to
a40063ef97688f056824b22b9e49fae6efd1df0f
and bazel 5.1.1.The text was updated successfully, but these errors were encountered: