we have two tests
core/src/test/scala/integration/kafka/api/MetricsTest.scalacore/src/test/scala/unit/kafka/metrics/MetricsTest.scala
We have one BUILD.bazel file under the root of core and scala_library will create two targets for this two files //core:src/test/scala/integration/kafka/api/MetricsTest_lib, //core:src/test/scala/unit/kafka/metrics/MetricsTest_lib.
It seems bazel coverage takes the BUILD.bazel file as root to create the .jar for both tests to the same directory core/MetricsTest_lib-offline.jar. That causes conflict.
I checked the coverage code, it seems related to this line. wonder why don't we use the full path here.
we have two tests
core/src/test/scala/integration/kafka/api/MetricsTest.scala
core/src/test/scala/unit/kafka/metrics/MetricsTest.scala
We have one BUILD.bazel file under the root of
core
andscala_library
will create two targets for this two files//core:src/test/scala/integration/kafka/api/MetricsTest_lib
,//core:src/test/scala/unit/kafka/metrics/MetricsTest_lib
.It seems bazel coverage takes the BUILD.bazel file as root to create the
.jar
for both tests to the same directorycore/MetricsTest_lib-offline.jar
. That causes conflict.I checked the coverage code, it seems related to this line. wonder why don't we use the full path here.
https://github.com/bazelbuild/rules_scala/blob/f9381414068466b9c74ff7681d204e1eb19c7f80/scala/private/phases/phase_coverage.bzl#L47