-
Notifications
You must be signed in to change notification settings - Fork 899
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
Code coverage? #30
Comments
This is on my roadmap. Happy to prioritize it. |
I was experimenting with jacoco. There is jacoco Gradle plugin, but it looks that it needs a bit of additional configuration for Kotlin and Android. It is not always that straight forward due to the usage of On top of the above there are two Gradle plugins that can simplify the configuration process (for multiple modules and potentially multiple build variants):
Next steps: |
I've had some difficulties setting it up for my project, especially because I had my tests in a separate module and I had to concatenate source folders from the others modules for jacoco to report coverage on them. If you're interested, you can look at the /gradle/coverage.gradle file in my project httpmocker: https://github.com/speekha/httpmocker |
Also Codacy and Codecov seem to interpret the reports differently. Codecov has a lot of missed lines (which are actually tested) that Codacy marks as covered. Not sure if that's because of a positive lack of accuracy on Codacy's part or a negative lack of accuracy on Codecov's part. |
thx for the project, I will take a look. This comparison between |
The differences I've noticed seemed linked to lines in kotlin that are interpreted as several different lines in Java: typically, a field declared in the kotlin constructor for instance that result in a constructor parameter, a field declaration, a getter and a setter in the byte code. So the same line can be marked as covered because the constructor parameter is executed but it can also be marked as not covered because the getter is not. Hard to decide which interpretation is the best, I guess. |
On top of quality checks with ktlint and detekt, it could be interesting to add coverage to your reports. I didn't find any mention of JaCoCo or any other option in your gradle files.
The text was updated successfully, but these errors were encountered: