kotlin-android-template icon indicating copy to clipboard operation
kotlin-android-template copied to clipboard

Setup test coverage with jacoco/codecov

Open cortinico opened this issue 5 years ago • 9 comments

⚠️ Is your feature request related to a problem? Please describe

Add support for code coverage

💡 Describe the solution you'd like

Ideally we could setup jacoco + codecov to have an automated test report after every push/pr.

🤚 Do you want to develop this feature yourself?

  • [ ] Yes
  • [x] No

This feature is up for grab

cortinico avatar Apr 25 '20 21:04 cortinico

I did something like this just a while back. I used the this plugin to generate Jacoco reports. This would be a small change. I did it in my own repo here. Let me know if you want me to work on this.

nikhil-thakkar avatar May 25 '20 19:05 nikhil-thakkar

I did something like this just a while back. I used the this plugin to generate Jacoco reports. This would be a small change. I did it in my own repo here. Let me know if you want me to work on this.

Hey @nikhil-thakkar Thanks for the suggestion. Ideally this should be doable by just using the jacoco Gradle plugin without other third party Gradle plugin.

cortinico avatar May 25 '20 22:05 cortinico

Are you able to generate code coverage with Git Actions? @cortinico @matthewcmckenna

tonghannteng avatar Sep 09 '20 05:09 tonghannteng

Not yet, this issue is up for grab 👍

cortinico avatar Sep 10 '20 16:09 cortinico

I'm using https://github.com/vanniktech/gradle-android-junit-jacoco-plugin instead of https://github.com/autonomousapps/jacoco-android-gradle-plugin bcz the latter seems not updated.

trietbui85 avatar Feb 13 '21 13:02 trietbui85

@cortinico

  1. Does jacoco for test files tell only about the lines covered or just the test status(passing/failing/ignored)?
  2. How does Android Studio's test coverage is different then Jacoco

Tried adding jacoco in one of the projects I am working on.

Android Studio Test Coverage

anandwana001 avatar Feb 27 '21 15:02 anandwana001

@cortinico

  1. Does jacoco for test files tell only about the lines covered or just the test status(passing/failing/ignored)?
  2. How does Android Studio's test coverage is different then Jacoco

How is this related to this issue? You should probably ask on StackOverflow, Twitter or on Jacoco's issue tracker.

cortinico avatar Feb 28 '21 10:02 cortinico

I put this intentionally here just to understand the requirement of the issue. Are we looking for a line to line code coverage here or just code coverage for test files for test results?

anandwana001 avatar Feb 28 '21 15:02 anandwana001

Are we looking for a line to line code coverage here or just code coverage for test files for test results?

The best would be to have a coverage report for the library- modules that consumer can integrated with their own tool (say codecov or others).

cortinico avatar Mar 12 '21 20:03 cortinico