1

My Bazel monorepo, has apps in Kotlin and Golang. In the earlier versions (For Go/Kotlin Bazel rules), the support for code coverage was not there but in the later rules-versions it's supported as per the rules_go and rules_kotlin documentation.

When I run the below command, the code coverage for only the Go apps is generated but not the Kotlin apps. I have upgraded to the latest rules_kotlin.

bazel coverage --combined_report=lcov --nocache_test_results --instrumentation_filter=//apps:<app-name>:<test-name> //...:all

FYI, following versions are used:

  • Bazel: 5.3.0
  • Kotlin rules: v1.7.1
  • Golang rules: v0.25.0
Bush
  • 261
  • 1
  • 11
  • If you are trying to get the complete coverage this answer is [helpful](https://stackoverflow.com/questions/46447218/using-bazel-to-generate-coverage-report) – SG_Bazel Jan 25 '23 at 10:47
  • The answer mentioned above is about generating the coverage report from the .dat file. My problem is that in Bazel monorepo, the .dat file doesn't cover any non-Go file; which in my case is Kotlin. No coverage for the kotlin file is being generated in the _coverage.dat file. – Bush Jan 27 '23 at 14:32

0 Answers0