vanniktech / gradle-android-junit-jacoco-plugin

Gradle plugin that generates JaCoCo reports from an Android Gradle Project
http://vanniktech.com
Apache License 2.0
400 stars 73 forks source link

Fix broken code cov #72

Closed jaredsburrows closed 7 years ago

jaredsburrows commented 7 years ago

CodeCov has not been updated in months: https://codecov.io/gh/vanniktech/gradle-android-junit-jacoco-plugin/commits

See the latest CI build: https://travis-ci.org/vanniktech/gradle-android-junit-jacoco-plugin#L364

    Executing gcov (find /home/travis/build/[secure]/gradle-android-junit-jacoco-plugin -type f -name '*.gcno'  -exec gcov -pb  {} +)
==> Collecting reports
Error: No coverage report found
Tip: See an example jdk repo: https://github.com/codecov/example-jdk
Support channels:
  Email:   hello@codecov.io
  IRC:     #codecov
  Gitter:  https://gitter.im/codecov/support
  Twitter: @codecov
Done. Your build exited with 0.
vanniktech commented 7 years ago

Yeah. It just suddenly stopped working.

jaredsburrows commented 7 years ago

Time to switch to coveralls?

gradlew build jacocoTestReport coveralls Source: https://github.com/jaredsburrows/gradle-license-plugin/blob/master/.travis.yml#L9

coveralls {
  jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}

Source: https://github.com/jaredsburrows/gradle-license-plugin/blob/master/gradle/quality.gradle#L9

I can make a PR, but you have to set it up at coveralls.io.

vanniktech commented 7 years ago

Yup let's switch if it's easier and has the same functionality.

jaredsburrows commented 7 years ago

@vanniktech Let me know when you have set this repo up with coveralls.io, I can make a PR for the rest.

vanniktech commented 7 years ago

Should be active now:

screen shot 2017-07-30 at 13 34 52
vanniktech commented 7 years ago

Seems to work now does not it? At least I'm seeing stuff here

jaredsburrows commented 7 years ago

It is weird that it says only 1 file? https://codecov.io/github/vanniktech/gradle-android-junit-jacoco-plugin?branch=master

vanniktech commented 7 years ago

True, I'll try deleting the codecov configuration file.

jaredsburrows commented 7 years ago

Any luck?

Jared Burrows

jaredsburrows@gmail.com jaredsburrows@gmail.com LinkedIn: https://www.linkedin.com/in/jaredsburrows

On Fri, Aug 4, 2017 at 9:29 AM, Niklas Baudy notifications@github.com wrote:

True, I'll try deleting the codecov configuration file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vanniktech/gradle-android-junit-jacoco-plugin/issues/72#issuecomment-320293478, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqMSKO9TEepjJWGFGfRjeNQhdE1Kjtrks5sU0b0gaJpZM4OjseX .

vanniktech commented 7 years ago

According to this it seems like it broke with Gradle 4.0

vanniktech commented 7 years ago

I'm pretty sure I found the reason now. After travis run the SNAPSHOT was built and then codecov was executed. Building the SNAPSHOT with clean uploadArchives the previously generated reports with clean build were deleted and hence codecov didn't do anything. I'd expect it to fail but it went silent. ¯_(ツ)_/¯

If you look at the travis logs in #78 you can see that the report was uploaded successfully.

jaredsburrows commented 7 years ago

Fixed by #78.

jaredsburrows commented 7 years ago

@vanniktech It still looks broken here: https://codecov.io/gh/vanniktech/gradle-android-junit-jacoco-plugin

vanniktech commented 7 years ago

Yeah I contacted the support team.

vanniktech commented 7 years ago

I'm super confused. It seems like codecov works on every android project but not on groovy gradle plugins or java libraries.

Also wrote in https://github.com/codecov/support/issues/374 but no response yet :(

jaredsburrows commented 7 years ago

Its time to switch to Coveralls :)

vanniktech commented 7 years ago

Do they also give you a summary for each PR?

jaredsburrows commented 7 years ago

Yes. Here is an example: https://coveralls.io/github/jaredsburrows/android-gif-example?branch=master.

vanniktech commented 7 years ago

But not on the PR itself right?

jaredsburrows commented 7 years ago

Yes. They are listed in that link. And it posts on the PR itself: https://github.com/jaredsburrows/android-gif-example/pull/22#issuecomment-319588297.

vanniktech commented 7 years ago

Awesome then let's switch.

vanniktech commented 7 years ago

Starting to think there's something in the generated report wrong. Coveralls also doesn't work - https://coveralls.io/github/vanniktech/gradle-android-junit-jacoco-plugin?branch=master

jaredsburrows commented 7 years ago

@vanniktech I believe you are right:

$ cat build/reports/jacoco/test/jacocoTestReport.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd"><report name="gradle-android-junit-jacoco-plugin"><sessioninfo id="s-MacBook-Pro.local-ed1f7c4f" start="1501540174380" dump="1501540183452"/><sessioninfo id="s-MBP.jetpack-b2b8c50e" start="1501634088702" dump="1501634097753"/><sessioninfo id="s-MBP.jetpack-747de4c" start="1501634170853" dump="1501634179070"/><sessioninfo id="s-MBP.jetpack-1f33f093" start="1501634182345" dump="1501634191147"/><sessioninfo id="s-MBP.jetpack-cf467f29" start="1501634256252" dump="1501634264563"/><sessioninfo id="s-MBP.jetpack-84c59f09" start="1501634311170" dump="1501634319355"/><sessioninfo id="s-MBP.jetpack-cc0bfde" start="1501634340744" dump="1501634349093"/><sessioninfo id="s-MBP.jetpack-cc5c9609" start="1501634442746" dump="1501634451049"/><sessioninfo id="s-MBP.jetpack-9cd95ba9" start="1501634504741" dump="1501634513139"/><sessioninfo id="s-MBP.jetpack-fbfb186f" start="1501634589073" dump="1501634597405"/><sessioninfo id="s-MBP.jetpack-6982b093" start="1501634909817" dump="1501634918335"/><sessioninfo id="s-MBP.jetpack-96834cd9" start="1501634927543" dump="1501634936383"/><sessioninfo id="s-MBP.jetpack-11eefeef" start="1501635153225" dump="1501635161694"/><sessioninfo id="s-MacBook-Pro.local-b15a7ee9" start="1502647969911" dump="1502647979776"/></report>
vanniktech commented 7 years ago

Yup there's definitely something wrong with java projects. I opened #81