bazel-contrib / bazel-contrib/rules_scala
How to run code coverage only for Scala targets
- Dominant language
- Starlark
- Stars
- 384
- Forks
- 292
- Avg merge
- 3d 3m
- Merged PRs (30d)
- 42
Description
I have a project with three targets (among others):
java_library(...)
scala_library(...)
scala_test(...)
Where the scala_library depends on the java_library and the scala_test depends on scala_library. If I run code coverage with this setup, if will execute that only for the java_library and scala code coverage won't be executed.
If I remove the java_library target, then everything works ok.
There is one solution I found: add "--instrumentation_filter=//*:scala_library" as a parameter when running coverage.
Is there any better way to fix this problem?
Contributor guide
Research direction
Start with the reported three-target setup and the coverage invocation, including --instrumentation_filter=//*:scala_library. Check how coverage selects instrumentation when scala_library depends on java_library; done means Scala coverage runs while the Java target remains present, without relying on removing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100