Skip to content

Commit

Permalink
Make coverage collection work for Buck2 + Robolectric
Browse files Browse the repository at this point in the history
Summary:
Updated Buck macros to generate class name to source mappings for Robolectric tests.

After doing that, coverage was failing because Jacoco was trying to process JARs which didn't exist locally. Fixed by ensuring that mappings are only generated for JARs which are present at runtime -- we shouldn't generate mappings for "provided" or "provided_exported" deps.

Reviewed By: IanChilds

Differential Revision: D44843318

fbshipit-source-id: b8a3fa862c3c9561e19a1d5b5c682ef60a5e2741
  • Loading branch information
loganwendholt authored and facebook-github-bot committed Apr 13, 2023
1 parent c341dea commit 9cd98c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions android/robolectric_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def robolectric_test_impl(ctx: "context") -> ["provider"]:
ctx,
java_providers.java_library_info,
java_providers.java_packaging_info,
java_providers.class_to_src_map,
extra_cmds = extra_cmds,
extra_classpath_entries = extra_classpath_entries,
)
Expand Down

0 comments on commit 9cd98c1

Please sign in to comment.