0

I am using Bazel with rules_scala. My problem now is how to exclude files from code coverage. So far this is how I am running coverage:

rm -rf coverage
bazel coverage --combined_report=lcov --coverage_report_generator="@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main" ... 
genhtml -o coverage --ignore-errors source bazel-out/_coverage/_coverage_report.dat

But there are some folders I would like to exclude from code coverage. I tried using the --instrumentation_filter flag, but no matter what I tried putting there Bazel still collect coverage for this folder.

Are there any examples how I should use this flag?

Thanks!

2 Answers 2

1

Use

bazel coverage --combined_report=lcov --coverage_report_generator="@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main" -- //... -//package/to/ignore/... 
Sign up to request clarification or add additional context in comments.

1 Comment

Tried that with the complete target and it didn't worked...
0

This appears to be a bug with rules_scala. See this issue for more details.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.