-
Notifications
You must be signed in to change notification settings - Fork 52
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
Kover CLI report generation does not reliably with --excludeAnnotation when using JAR (instead of folder) for --classfiles #709
Comments
@oliviernotteghem Could you please look into the bytecode of the class inside jar, and check that the annotation is present there? |
@zuevmaxim : I forgot to mention that we verified this already. The annotation is not stripped and is present in bytecode. |
@oliviernotteghem, to reproduce it locally we need reproducer project or a problematic jar file |
Sure. Here is problematic jar The code corresponds to the screenshot below. During report generation, we use |
Thanks for the reproducer. Try this way @Expose
fun composeDeps(
) =
@Expose object : composeDependencies {
// ...
} *I understand that the |
@shanshin how would you explain filtering works when --classfiles points to a folder (containing unpacked JAR) instead of the JAR itself? |
Due to the fact that the order of class-files in jar is unstable, in some cases the annotation exclusion may not work for nested lambdas. Fixes #709
Fixed in |
Thank you very much. We upgraded to 0.9.0 and can confirm the issue is gone. There seems to be other fixes as well as our code coverage for failing module is not non-null, which materializes into a nice code coverage increase for Uber android monorepo :) |
We found instances where, when using --classfiles to point to a JAR, --excludeAnnotation does not work completely and some code that should be excluded still appear to be covered.
With the same command line have --classfiles pointing to a folder, when the JAR was unpacked, the filtering works reliably.
Example of command line invocation :
java -jar /Users/oliviern/.devxp/import-cache/4b81c0960d39ddd828f97e31aee273bf0d929d87/3c34899b72c05e31efaa6ed042ad0527573034a1/kover-cli-0.8.2.jar @bazel-bin/libraries/foundation/ui/ui-compose-ambients/test_release-kover_metadata.txt --xml bazel-bin/libraries/foundation/ui/ui-compose-ambients/test_release-kover_report.xml --html /Users/oliviern/Uber/android/bazel-testlogs/libraries/foundation/ui/ui-compose-ambients/test_release/coverage_report
content of bazel-bin/libraries/foundation/ui/ui-compose-ambients/test_release-kover_metadata.txt:
example of code failing to be filtered out:
The text was updated successfully, but these errors were encountered: