Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for code coverage. #505

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

jongerrish
Copy link
Contributor

  • kt_jvm_test supports coverage collection.
  • kt_jvm_library propagates transitive coverage information.

This provides coverage support of Java code in java_library + android_library targets through kt_jvm_test.

It also provides coverage support of Java code in kt_jvm_library when experimental_use_abi_jars is enabled.

TODO: Instrument Kotlin code for coverage.

Partially addresses: #300

@@ -891,4 +900,10 @@ def export_only_providers(ctx, actions, attr, outputs):
getattr(attr, "exports", []),
),
),
instrumented_files = coverage_common.instrumented_files_info(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

identical code here and above, consider unifying

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about how but its not super easy in a way that has value. I see now why folks tend to implement a "pipeline" pattern to of provider producers.

* `kt_jvm_test` supports coverage collection.
* `kt_jvm_library` propagates transitive coverage information.

This provides coverage support of Java code in `java_library` + `android_library` targets through `kt_jvm_test.`

It also provides coverage support of Java code in `kt_jvm_library` when experimental_use_abi_jars is enabled.

TODO: Instrument Kotlin code for coverage.
@restingbull restingbull merged commit 0a2440b into bazelbuild:master Mar 18, 2021
@sgammon sgammon mentioned this pull request Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants