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

Generated Coverage Reports not Accurately Reflected in Codecov #147

Open
sdzhong opened this issue Aug 15, 2024 · 1 comment
Open

Generated Coverage Reports not Accurately Reflected in Codecov #147

sdzhong opened this issue Aug 15, 2024 · 1 comment

Comments

@sdzhong
Copy link
Contributor

sdzhong commented Aug 15, 2024

@yuval-sentry
Copy link
Collaborator

Here is some context from the discussion that we had:

Stefano Siano
Stefano Siano

  Aug 1st at 3:17 AM
[Android] The demo app is setting up test coverage.
Jacoco was added and shows the classes, but coverage is always 0%. Can someone help understanding why?
Zip

reports.zip
Zip

21 replies


Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 3:44 AM
if you/ci is running Java 17, you might wanna bump the jacoco version to 0.8.10 here: main...new_tests#diff-51a0b488f963eb0be6c6599bf5df497313877cf5bdff3950807373912ac1cdc9R140

Stefano Siano
Stefano Siano

  Aug 1st at 3:46 AM
i tried upgrading gradle and changing to 0.8.10, but it still shows 0%

Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 3:46 AM
if that doesn't help, we use a different plugin for jacoco-android tests: https://github.com/getsentry/sentry-java/blob/ae2294fdca3b6134b6bba7dce756b4a622a6f1ef/buildSrc/src/main/java/Config.kt#L219-L220, maybe that one works better idk

Config.kt
       val jacocoAndroid = "com.mxalbert.gradle.jacoco-android"
       val jacocoAndroidVersion = "0.2.0"

getsentry/sentry-java | Added by GitHub

Stefano Siano
Stefano Siano

  Aug 1st at 4:01 AM
tried it, but it doesn’t compile
Unable to find method ''void com.android.build.api.variant.AndroidComponentsExtension.onVariants$default(com.android.build.api.variant.AndroidComponentsExtension, com.android.build.api.variant.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)''
'void com.android.build.api.variant.AndroidComponentsExtension.onVariants$default(com.android.build.api.variant.AndroidComponentsExtension, com.android.build.api.variant.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)'

Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 4:01 AM
bump agp to 7+?
4:01
if not yet

Stefano Siano
Stefano Siano

  Aug 1st at 4:01 AM
it’s 7.2.1
4:01
and gradle 7.3.3

Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 4:02 AM
idk maybe 7.4+? although this method existed from 7.0 if I'm not wrong

Stefano Siano
Stefano Siano

  Aug 1st at 4:08 AM
A problem occurred configuring project ':app'.

No such property: variantDependencies for class: com.android.build.gradle.internal.variant.ApplicationVariantData

1


Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 4:08 AM
lel
4:09
might be coming from some other plugin, because it works for us in sentry-java

Stefano Siano
Stefano Siano

  Aug 1st at 4:09 AM
the infamous “it works for me” 

4:10
i’ll try something else, thanks for the help

Roman Zavarnitsyn
Roman Zavarnitsyn

  Aug 1st at 4:10 AM
yea try to comment out some other gradle plugins or bump their version
4:10
native-aar, nativeBundle, fullstory
4:10
must be one of those

Stefano Siano
Stefano Siano

  Aug 1st at 4:12 AM
it seems native-aar
4:13
i’ll decomment things back and check again

Stefano Siano
Stefano Siano

  Aug 1st at 6:56 AM
i updated plugins and libraries and now it compiles with the plugin we use in the Sentry SDK, but it still shows 0 coverage…

Yuval Nachon
Yuval Nachon
  Aug 2nd at 12:36 PM
cc 
@neil
 for visibility

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

No branches or pull requests

2 participants